2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
autopep8,
|
|
|
|
buildPythonPackage,
|
|
|
|
docstring-to-markdown,
|
|
|
|
fetchFromGitHub,
|
|
|
|
flake8,
|
|
|
|
flaky,
|
|
|
|
importlib-metadata,
|
|
|
|
jedi,
|
|
|
|
matplotlib,
|
|
|
|
mccabe,
|
|
|
|
numpy,
|
|
|
|
pandas,
|
|
|
|
pluggy,
|
|
|
|
pycodestyle,
|
|
|
|
pydocstyle,
|
|
|
|
pyflakes,
|
|
|
|
pylint,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-lsp-jsonrpc,
|
|
|
|
pythonOlder,
|
|
|
|
rope,
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
toml,
|
|
|
|
ujson,
|
|
|
|
websockets,
|
|
|
|
whatthepatch,
|
|
|
|
yapf,
|
2021-07-04 02:40:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-lsp-server";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "1.11.0";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "pyproject";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-lsp";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "python-lsp-server";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-0DFcnGlyDOK0Lxpr++xV6klhFF9b1fihH5FY/tblr+E=";
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail "--cov-report html --cov-report term --junitxml=pytest.xml" "" \
|
|
|
|
--replace-fail "--cov pylsp --cov test" ""
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"autopep8"
|
|
|
|
"flake8"
|
|
|
|
"mccabe"
|
|
|
|
"pycodestyle"
|
|
|
|
"pydocstyle"
|
|
|
|
"pyflakes"
|
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
|
|
|
|
|
|
|
build-system = [ setuptools-scm ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2022-11-04 12:27:35 +00:00
|
|
|
docstring-to-markdown
|
2021-07-04 02:40:35 +00:00
|
|
|
jedi
|
|
|
|
pluggy
|
|
|
|
python-lsp-jsonrpc
|
2022-11-21 17:40:18 +00:00
|
|
|
setuptools # `pkg_resources`imported in pylsp/config/config.py
|
2021-07-04 02:40:35 +00:00
|
|
|
ujson
|
2024-04-21 15:54:59 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.10") [ importlib-metadata ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
|
|
|
passthru.optional-dependencies = {
|
|
|
|
all = [
|
|
|
|
autopep8
|
|
|
|
flake8
|
|
|
|
mccabe
|
|
|
|
pycodestyle
|
|
|
|
pydocstyle
|
|
|
|
pyflakes
|
|
|
|
pylint
|
|
|
|
rope
|
2022-11-27 09:42:12 +00:00
|
|
|
toml
|
2022-11-02 22:02:43 +00:00
|
|
|
whatthepatch
|
|
|
|
yapf
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
autopep8 = [ autopep8 ];
|
|
|
|
flake8 = [ flake8 ];
|
|
|
|
mccabe = [ mccabe ];
|
|
|
|
pycodestyle = [ pycodestyle ];
|
|
|
|
pydocstyle = [ pydocstyle ];
|
|
|
|
pyflakes = [ pyflakes ];
|
|
|
|
pylint = [ pylint ];
|
|
|
|
rope = [ rope ];
|
2022-11-02 22:02:43 +00:00
|
|
|
yapf = [
|
|
|
|
whatthepatch
|
|
|
|
yapf
|
|
|
|
];
|
2024-04-21 15:54:59 +00:00
|
|
|
websockets = [ websockets ];
|
2022-11-02 22:02:43 +00:00
|
|
|
};
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs =
|
|
|
|
[
|
|
|
|
flaky
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pytestCheckHook
|
|
|
|
]
|
2024-07-27 06:49:29 +00:00
|
|
|
++ passthru.optional-dependencies.all;
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# Don't run lint tests
|
|
|
|
"test_pydocstyle"
|
|
|
|
# https://github.com/python-lsp/python-lsp-server/issues/243
|
|
|
|
"test_numpy_completions"
|
|
|
|
"test_workspace_loads_pycodestyle_config"
|
|
|
|
"test_autoimport_code_actions_and_completions_for_notebook_document"
|
2024-07-27 06:49:29 +00:00
|
|
|
# avoid dependencies on many Qt things just to run one singular test
|
2024-04-21 15:54:59 +00:00
|
|
|
"test_pyqt_completion"
|
|
|
|
];
|
2021-08-23 08:02:39 +00:00
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"pylsp"
|
2022-11-21 17:40:18 +00:00
|
|
|
"pylsp.python_lsp"
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python implementation of the Language Server Protocol";
|
|
|
|
homepage = "https://github.com/python-lsp/python-lsp-server";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/python-lsp/python-lsp-server/blob/v${version}/CHANGELOG.md";
|
2021-07-04 02:40:35 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
2023-03-24 00:07:29 +00:00
|
|
|
mainProgram = "pylsp";
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
}
|