From 43326297e35e601c591928174c233a0a1c99bb4e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sun, 26 Nov 2023 18:24:16 +0100 Subject: [PATCH] python311Packages.python-lsp-ruff: 1.6.0 -> 2.0.0 Changelog: https://github.com/python-lsp/python-lsp-ruff/releases/tag/v2.0.0 --- .../python-modules/python-lsp-ruff/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/python-lsp-ruff/default.nix b/pkgs/development/python-modules/python-lsp-ruff/default.nix index eae9047c9f9d..01d9e4eb49d1 100644 --- a/pkgs/development/python-modules/python-lsp-ruff/default.nix +++ b/pkgs/development/python-modules/python-lsp-ruff/default.nix @@ -3,37 +3,45 @@ , buildPythonPackage , fetchPypi , ruff +, cattrs , lsprotocol , python-lsp-server , tomli +, pytestCheckHook }: buildPythonPackage rec { pname = "python-lsp-ruff"; - version = "1.6.0"; - format = "pyproject"; - disabled = pythonOlder "3.7"; + version = "2.0.0"; + pyproject = true; + disabled = pythonOlder "3.8"; src = fetchPypi { inherit version; pname = "python-lsp-ruff"; - sha256 = "sha256-vf3ZNZyen1W29qk4ST1sus5VTcys9F3067NlUr406bg="; + sha256 = "sha256-lCTBFKTb1djrRQcX4Eg/G2Fs+VrqTvJ/XVnUPVM/5nE="; }; postPatch = '' # ruff binary is used directly, the ruff python package is not needed sed -i '/"ruff>=/d' pyproject.toml sed -i 's|sys.executable, "-m", "ruff"|"${ruff}/bin/ruff"|' pylsp_ruff/plugin.py + sed -i -e '/sys.executable/,+2c"${ruff}/bin/ruff",' -e 's|assert "ruff" in call_args|assert "${ruff}/bin/ruff" in call_args|' tests/test_ruff_lint.py + # Nix builds everything in /build/ but ruff somehow doesn't run on files in /build/ and outputs empty results. + sed -i -e "s|workspace.root_path|'/tmp/'|g" tests/*.py ''; propagatedBuildInputs = [ + cattrs lsprotocol python-lsp-server ] ++ lib.optionals (pythonOlder "3.11") [ tomli ]; - doCheck = true; + nativeCheckInputs = [ + pytestCheckHook + ]; meta = with lib; { homepage = "https://github.com/python-lsp/python-lsp-ruff";