Skip to content

Commit

Permalink
python3Packages.python-lsp-server: fix test issues from 1.5.0 upgrade
Browse files Browse the repository at this point in the history
Changes:
* The `test_numpy_completion` test is currently broken - see davidhalter/jedi#1864
* The test flags were moved from setup.cfg to pyproject.toml - see python-lsp/python-lsp-server#207
* A dependency on `whatthepatch` was added for yapf - see python-lsp/python-lsp-server#136
  • Loading branch information
lilyinstarlight committed Jul 30, 2022
1 parent 38f80ff commit 42ce6d8
Showing 1 changed file with 9 additions and 4 deletions.
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

0 comments on commit 42ce6d8

Please sign in to comment.