36 buildPythonPackage rec {
37 pname = "python-lsp-server";
41 disabled = pythonOlder "3.8";
43 src = fetchFromGitHub {
45 repo = "python-lsp-server";
46 rev = "refs/tags/v${version}";
47 hash = "sha256-0DFcnGlyDOK0Lxpr++xV6klhFF9b1fihH5FY/tblr+E=";
51 substituteInPlace pyproject.toml \
52 --replace-fail "--cov-report html --cov-report term --junitxml=pytest.xml" "" \
53 --replace-fail "--cov pylsp --cov test" ""
65 nativeBuildInputs = [ setuptools-scm ];
67 build-system = [ setuptools-scm ];
74 setuptools # `pkg_resources`imported in pylsp/config/config.py
76 ] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
78 passthru.optional-dependencies = {
92 autopep8 = [ autopep8 ];
95 pycodestyle = [ pycodestyle ];
96 pydocstyle = [ pydocstyle ];
97 pyflakes = [ pyflakes ];
104 websockets = [ websockets ];
115 ++ passthru.optional-dependencies.all
116 # pyqt5 is broken on aarch64-darwin
117 ++ lib.optionals (!stdenv.isDarwin || !stdenv.isAarch64) [ pyqt5 ];
121 # Don't run lint tests
123 # https://github.com/python-lsp/python-lsp-server/issues/243
124 "test_numpy_completions"
125 "test_workspace_loads_pycodestyle_config"
126 "test_autoimport_code_actions_and_completions_for_notebook_document"
128 ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
129 # pyqt5 is broken on aarch64-darwin
130 "test_pyqt_completion"
134 export HOME=$(mktemp -d);
137 pythonImportsCheck = [
143 description = "Python implementation of the Language Server Protocol";
144 homepage = "https://github.com/python-lsp/python-lsp-server";
145 changelog = "https://github.com/python-lsp/python-lsp-server/blob/v${version}/CHANGELOG.md";
146 license = licenses.mit;
147 maintainers = with maintainers; [ fab ];
148 mainProgram = "pylsp";