2021-07-04 02:40:35 +00:00
|
|
|
{ lib
|
|
|
|
, autopep8
|
|
|
|
, buildPythonPackage
|
|
|
|
, 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
|
2021-07-04 02:40:35 +00:00
|
|
|
, ujson
|
|
|
|
, yapf
|
2021-08-23 08:02:39 +00:00
|
|
|
, withAutopep8 ? true
|
|
|
|
, withFlake8 ? true
|
|
|
|
, withMccabe ? true
|
|
|
|
, withPycodestyle ? true
|
|
|
|
, withPydocstyle ? true
|
|
|
|
, withPyflakes ? true
|
|
|
|
, withPylint ? true
|
|
|
|
, withRope ? true
|
|
|
|
, withYapf ? true
|
2021-07-04 02:40:35 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "python-lsp-server";
|
2021-08-22 07:53:02 +00:00
|
|
|
version = "1.2.1";
|
2021-07-04 02:40:35 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "python-lsp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-08-22 07:53:02 +00:00
|
|
|
sha256 = "sha256-TyXKlXeXMyq+bQq9ngDm0SuW+rAhDlOVlC3mDI1THwk=";
|
2021-07-04 02:40:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jedi
|
|
|
|
pluggy
|
|
|
|
python-lsp-jsonrpc
|
2021-07-16 19:40:57 +00:00
|
|
|
setuptools
|
2021-07-04 02:40:35 +00:00
|
|
|
ujson
|
2021-08-23 08:02:39 +00:00
|
|
|
] ++ lib.optional withAutopep8 autopep8
|
|
|
|
++ lib.optional withFlake8 flake8
|
|
|
|
++ lib.optional withMccabe mccabe
|
|
|
|
++ lib.optional withPycodestyle pycodestyle
|
|
|
|
++ lib.optional withPydocstyle pydocstyle
|
|
|
|
++ lib.optional withPyflakes pyflakes
|
|
|
|
++ lib.optional withPylint pylint
|
|
|
|
++ lib.optional withRope rope
|
|
|
|
++ lib.optional withYapf yapf;
|
2021-07-04 02:40:35 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
flaky
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
pandas
|
|
|
|
pyqt5
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2021-08-23 08:02:39 +00:00
|
|
|
disabledTests = lib.optional (!withPycodestyle) "test_workspace_loads_pycodestyle_config";
|
|
|
|
|
|
|
|
disabledTestPaths = lib.optional (!withAutopep8) "test/plugins/test_autopep8_format.py"
|
|
|
|
++ lib.optional (!withRope) "test/plugins/test_completion.py"
|
|
|
|
++ lib.optional (!withFlake8) "test/plugins/test_flake8_lint.py"
|
|
|
|
++ lib.optional (!withMccabe) "test/plugins/test_mccabe_lint.py"
|
|
|
|
++ lib.optional (!withPycodestyle) "test/plugins/test_pycodestyle_lint.py"
|
|
|
|
++ lib.optional (!withPydocstyle) "test/plugins/test_pydocstyle_lint.py"
|
|
|
|
++ lib.optional (!withPyflakes) "test/plugins/test_pyflakes_lint.py"
|
|
|
|
++ lib.optional (!withPylint) "test/plugins/test_pylint_lint.py"
|
|
|
|
++ lib.optional (!withRope) "test/plugins/test_rope_rename.py"
|
|
|
|
++ lib.optional (!withYapf) "test/plugins/test_yapf_format.py";
|
|
|
|
|
2021-07-04 02:40:35 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace "--cov-report html --cov-report term --junitxml=pytest.xml" "" \
|
|
|
|
--replace "--cov pylsp --cov test" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d);
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pylsp" ];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|