Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions pkgs/development/python-modules/python-lsp-server/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
, stdenv
, ujson
, yapf
, whatthepatch
, withAutopep8 ? true
, withFlake8 ? true
, withMccabe ? true
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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";

Expand Down
26 changes: 26 additions & 0 deletions pkgs/development/python-modules/whatthepatch/default.nix
Original file line number Diff line number Diff line change
@@ -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;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { };
Expand Down