2021-07-04 02:40:35 +00:00
|
|
|
{ lib
|
2022-11-02 22:02:43 +00:00
|
|
|
, stdenv
|
2021-07-04 02:40:35 +00:00
|
|
|
, autopep8
|
|
|
|
, buildPythonPackage
|
2022-11-04 12:27:35 +00:00
|
|
|
, docstring-to-markdown
|
2021-07-04 02:40:35 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, flake8
|
|
|
|
, flaky
|
|
|
|
, jedi
|
|
|
|
, matplotlib
|
|
|
|
, mccabe
|
|
|
|
, numpy
|
|
|
|
, pandas
|
|
|
|
, pluggy
|
|
|
|
, pycodestyle
|
|
|
|
, pydocstyle
|
|
|
|
, pyflakes
|
|
|
|
, pylint
|
|
|
|
, pyqt5
|
|
|
|
, pytestCheckHook
|
2023-02-02 18:25:31 +00:00
|
|
|
, pythonRelaxDepsHook
|
2021-07-04 02:40:35 +00:00
|
|
|
, python-lsp-jsonrpc
|
|
|
|
, pythonOlder
|
|
|
|
, rope
|
2021-07-16 19:40:57 +00:00
|
|
|
, setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
, setuptools-scm
|
2022-11-27 09:42:12 +00:00
|
|
|
, toml
|
2021-07-04 02:40:35 +00:00
|
|
|
, ujson
|
2022-11-02 22:02:43 +00:00
|
|
|
, websockets
|
2022-08-12 12:06:08 +00:00
|
|
|
, whatthepatch
|
2021-07-04 02:40:35 +00:00
|
|
|
, yapf
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-lsp-server";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.7.1";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "pyproject";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-lsp";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-Rx8mHBmJw4gh0FtQBVMmOlQklODplrhnWwzsEhQm4NE=";
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
2022-08-12 12:06:08 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
2021-09-18 10:52:07 +00:00
|
|
|
--replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \
|
2023-02-02 18:25:31 +00:00
|
|
|
--replace "--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"
|
|
|
|
];
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
nativeBuildInputs = [
|
2023-02-02 18:25:31 +00:00
|
|
|
pythonRelaxDepsHook
|
2022-11-04 12:27:35 +00:00
|
|
|
setuptools-scm
|
|
|
|
];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
propagatedBuildInputs = [
|
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
|
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
|
|
|
|
];
|
|
|
|
autopep8 = [
|
|
|
|
autopep8
|
|
|
|
];
|
|
|
|
flake8 = [
|
|
|
|
flake8
|
|
|
|
];
|
|
|
|
mccabe = [
|
|
|
|
mccabe
|
|
|
|
];
|
|
|
|
pycodestyle = [
|
|
|
|
pycodestyle
|
|
|
|
];
|
|
|
|
pydocstyle = [
|
|
|
|
pydocstyle
|
|
|
|
];
|
|
|
|
pyflakes = [
|
|
|
|
pyflakes
|
|
|
|
];
|
|
|
|
pylint = [
|
|
|
|
pylint
|
|
|
|
];
|
|
|
|
rope = [
|
|
|
|
rope
|
|
|
|
];
|
|
|
|
yapf = [
|
|
|
|
whatthepatch
|
|
|
|
yapf
|
|
|
|
];
|
|
|
|
websockets = [
|
|
|
|
websockets
|
|
|
|
];
|
|
|
|
};
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-07-04 02:40:35 +00:00
|
|
|
flaky
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pytestCheckHook
|
2022-11-02 22:02:43 +00:00
|
|
|
] ++ passthru.optional-dependencies.all
|
2022-02-10 20:34:41 +00:00
|
|
|
# pyqt5 is broken on aarch64-darwin
|
2022-11-02 22:02:43 +00:00
|
|
|
++ lib.optionals (!stdenv.isDarwin || !stdenv.isAarch64) [
|
|
|
|
pyqt5
|
|
|
|
];
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
disabledTests = [
|
2023-02-02 18:25:31 +00:00
|
|
|
# Don't run lint tests
|
|
|
|
"test_pydocstyle"
|
2022-11-02 22:02:43 +00:00
|
|
|
# https://github.com/python-lsp/python-lsp-server/issues/243
|
|
|
|
"test_numpy_completions"
|
|
|
|
"test_workspace_loads_pycodestyle_config"
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
|
2022-11-02 22:02:43 +00:00
|
|
|
# pyqt5 is broken on aarch64-darwin
|
|
|
|
"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
|
|
|
};
|
|
|
|
}
|