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
|
|
|
|
, python-lsp-jsonrpc
|
|
|
|
, pythonOlder
|
|
|
|
, rope
|
2021-07-16 19:40:57 +00:00
|
|
|
, setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
, setuptools-scm
|
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";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "1.6.0";
|
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}";
|
2022-11-04 12:27:35 +00:00
|
|
|
sha256 = "sha256-1LV8FcwQqUg+FIkrorBYlxMl4F1PkrrOWjD5M0JSp3Q=";
|
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" "" \
|
2022-05-18 14:49:53 +00:00
|
|
|
--replace "--cov pylsp --cov test" "" \
|
2022-11-02 22:02:43 +00:00
|
|
|
--replace "autopep8>=1.6.0,<1.7.0" "autopep8" \
|
2022-11-04 12:27:35 +00:00
|
|
|
--replace "flake8>=5.0.0,<5.1.0" "flake8" \
|
|
|
|
--replace "mccabe>=0.7.0,<0.8.0" "mccabe" \
|
|
|
|
--replace "pycodestyle>=2.9.0,<2.10.0" "pycodestyle" \
|
|
|
|
--replace "pyflakes>=2.5.0,<2.6.0" "pyflakes"
|
2022-05-18 14:49:53 +00:00
|
|
|
'';
|
|
|
|
|
2022-11-04 12:27:35 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
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 = [
|
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"
|
|
|
|
] ++ lib.optional (stdenv.isDarwin && stdenv.isAarch64) [
|
|
|
|
# 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";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|