@@ -0,0 +1,48 @@
1+{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, isPy27
2+, configparser, futures, future, jedi, pluggy
3+, pytest, mock, pytestcov, coverage
4+# The following packages are optional and
5+# can be overwritten with null as your liking.
6+# This also requires to disable tests.
7+, rope ? null
8+, mccabe ? null
9+, pyflakes ? null
10+, pycodestyle ? null
11+, autopep8 ? null
12+, yapf ? null
13+, pydocstyle ? null
14+}:
15+
16+buildPythonPackage rec {
17+ pname = "python-language-server";
18+ version = "0.18.0";
19+
20+ src = fetchFromGitHub {
21+ owner = "palantir";
22+ repo = "python-language-server";
23+ rev = version;
24+ sha256 = "0ig34bc0qm6gdj8xakmm3877lmf8ms7qg0xj8hay9gpgf8cz894s";
25+ };
26+
27+ checkInputs = [
28+ pytest mock pytestcov coverage
29+ # rope is technically a dependency, but we don't add it by default since we
30+ # already have jedi, which is the preferred option
31+ rope
32+ ];
33+ checkPhase = ''
34+ HOME=$TEMPDIR pytest
35+ '';
36+
37+ propagatedBuildInputs = [
38+ jedi pluggy mccabe pyflakes pycodestyle yapf pydocstyle future autopep8
39+ ] ++ lib.optional (isPy27) [ configparser ]
40+ ++ lib.optional (pythonOlder "3.2") [ futures ];
41+
42+ meta = with lib; {
43+ homepage = https://github.com/palantir/python-language-server;
44+ description = "An implementation of the Language Server Protocol for Python";
45+ license = licenses.mit;
46+ maintainers = [ maintainers.mic92 ];
47+ };
48+}