From 38f80ffd938c2a1635ea0cf0e49741859bd06a7d Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Sat, 30 Jul 2022 14:46:05 -0400 Subject: [PATCH 1/2] python3Packages.whatthepatch: init at 1.0.2 --- .../python-modules/whatthepatch/default.nix | 26 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/python-modules/whatthepatch/default.nix diff --git a/pkgs/development/python-modules/whatthepatch/default.nix b/pkgs/development/python-modules/whatthepatch/default.nix new file mode 100644 index 0000000000000..eda49a2ef756d --- /dev/null +++ b/pkgs/development/python-modules/whatthepatch/default.nix @@ -0,0 +1,26 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "whatthepatch"; + version = "1.0.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "sha256-xUDqWRc+CikeGcdC3YtAbFbivgOaYA7bfG/Drku9+p8="; + }; + + checkInputs = [ + pytestCheckHook + ]; + + meta = with lib; { + homepage = "https://github.com/cscorley/whatthepatch"; + description = "A Python patch parsing library"; + maintainers = with maintainers; [ lilyinstarlight ]; + license = licenses.mit; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5122f35a058e7..cd9f40af4152b 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11357,6 +11357,8 @@ in { wget = callPackage ../development/python-modules/wget { }; + whatthepatch = callPackage ../development/python-modules/whatthepatch { }; + wheel = callPackage ../development/python-modules/wheel { }; wheel-filename = callPackage ../development/python-modules/wheel-filename { }; From 42ce6d85181a1c05840f9732e856df4e51cf808a Mon Sep 17 00:00:00 2001 From: Lily Foster Date: Sat, 30 Jul 2022 14:50:32 -0400 Subject: [PATCH 2/2] python3Packages.python-lsp-server: fix test issues from 1.5.0 upgrade Changes: * The `test_numpy_completion` test is currently broken - see https://github.com/davidhalter/jedi/issues/1864 * The test flags were moved from setup.cfg to pyproject.toml - see https://github.com/python-lsp/python-lsp-server/pull/207 * A dependency on `whatthepatch` was added for yapf - see https://github.com/python-lsp/python-lsp-server/pull/136 --- .../python-modules/python-lsp-server/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/python-lsp-server/default.nix b/pkgs/development/python-modules/python-lsp-server/default.nix index 41af2ad8e3ef3..babade21d3a4e 100644 --- a/pkgs/development/python-modules/python-lsp-server/default.nix +++ b/pkgs/development/python-modules/python-lsp-server/default.nix @@ -24,6 +24,7 @@ , stdenv , ujson , yapf +, whatthepatch , withAutopep8 ? true , withFlake8 ? true , withMccabe ? true @@ -45,12 +46,12 @@ buildPythonPackage rec { src = fetchFromGitHub { owner = "python-lsp"; repo = pname; - rev = "refs/tags/v${version}"; + rev = "v${version}"; sha256 = "sha256-tW2w94HI6iy8vcDb5pIL79bAO6BJp9q6SMAXgiVobm0="; }; postPatch = '' - substituteInPlace setup.cfg \ + substituteInPlace pyproject.toml \ --replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \ --replace "--cov pylsp --cov test" "" \ --replace "mccabe>=0.6.0,<0.7.0" "mccabe" @@ -75,7 +76,7 @@ buildPythonPackage rec { ++ lib.optional withPyflakes pyflakes ++ lib.optional withPylint pylint ++ lib.optional withRope rope - ++ lib.optional withYapf yapf; + ++ lib.optionals withYapf [ yapf whatthepatch ]; checkInputs = [ flaky @@ -87,7 +88,11 @@ buildPythonPackage rec { # pyqt5 is broken on aarch64-darwin ++ lib.optionals (!stdenv.isDarwin || !stdenv.isAarch64) [ pyqt5 ]; - disabledTests = lib.optional (!withPycodestyle) "test_workspace_loads_pycodestyle_config" + disabledTests = [ + # Test currently broken due to https://github.com/davidhalter/jedi/issues/1864 + "test_numpy_completion" + ] + ++ lib.optional (!withPycodestyle) "test_workspace_loads_pycodestyle_config" # pyqt5 is broken on aarch64-darwin ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) "test_pyqt_completion";