summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2018-08-07 01:25:38 +0100
committerGitHub <noreply@github.com>2018-08-07 01:25:38 +0100
commit9d825127b5e10d1e205a19b35d0c1ba429a87c2f (patch)
treebd607c4976e2108fd7c6eeaacc70e88a35d1f894 /pkgs/development
parent00991101a04eebed0b68881d76b95f82e7fdf011 (diff)
parent5b2ff695449519ed6bb31736d8a48ab132f6a0d9 (diff)
downloadnixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar.gz
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar.bz2
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar.lz
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar.xz
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.tar.zst
nixlib-9d825127b5e10d1e205a19b35d0c1ba429a87c2f.zip
Merge pull request #44567 from LnL7/python-language-server
python-language-server: 0.18.0 -> 0.19.0
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/python-language-server/default.nix45
1 files changed, 30 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/python-language-server/default.nix b/pkgs/development/python-modules/python-language-server/default.nix
index c2df1f85325c..800c9eba2abb 100644
--- a/pkgs/development/python-modules/python-language-server/default.nix
+++ b/pkgs/development/python-modules/python-language-server/default.nix
@@ -1,45 +1,60 @@
-{ lib, buildPythonPackage, fetchFromGitHub, pythonOlder, isPy27
+{ stdenv, buildPythonPackage, fetchFromGitHub, pythonOlder, isPy27
 , configparser, futures, future, jedi, pluggy
 , pytest, mock, pytestcov, coverage
-# The following packages are optional and
-# can be overwritten with null as your liking.
-# This also requires to disable tests.
-, rope ? null
+, # Allow building a limited set of providers, e.g. ["pycodestyle"].
+  providers ? ["*"]
+  # The following packages are optional and
+  # can be overwritten with null as your liking.
+, autopep8 ? null
 , mccabe ? null
-, pyflakes ? null
 , pycodestyle ? null
-, autopep8 ? null
-, yapf ? null
 , pydocstyle ? null
+, pyflakes ? null
+, rope ? null
+, yapf ? null
 }:
 
+let
+  withProvider = p: builtins.elem "*" providers || builtins.elem p providers;
+in
+
 buildPythonPackage rec {
   pname = "python-language-server";
-  version = "0.18.0";
+  version = "0.19.0";
 
   src = fetchFromGitHub {
     owner = "palantir";
     repo = "python-language-server";
     rev = version;
-    sha256 = "0ig34bc0qm6gdj8xakmm3877lmf8ms7qg0xj8hay9gpgf8cz894s";
+    sha256 = "0glnhnjmsnnh1vs73n9dglknfkhcgp03nkjbpz0phh1jlqrkrwm6";
   };
 
+  # The tests require all the providers, disable otherwise.
+  doCheck = providers == ["*"];
+
   checkInputs = [
     pytest mock pytestcov coverage
     # rope is technically a dependency, but we don't add it by default since we
     # already have jedi, which is the preferred option
     rope
   ];
+
   checkPhase = ''
     HOME=$TEMPDIR pytest
   '';
 
-  propagatedBuildInputs = [
-    jedi pluggy mccabe pyflakes pycodestyle yapf pydocstyle future autopep8
-  ] ++ lib.optional (isPy27) [ configparser ]
-    ++ lib.optional (pythonOlder "3.2") [ futures ];
+  propagatedBuildInputs = [ jedi pluggy future ]
+    ++ stdenv.lib.optional (withProvider "autopep8") autopep8
+    ++ stdenv.lib.optional (withProvider "mccabe") mccabe
+    ++ stdenv.lib.optional (withProvider "pycodestyle") pycodestyle
+    ++ stdenv.lib.optional (withProvider "pydocstyle") pydocstyle
+    ++ stdenv.lib.optional (withProvider "pyflakes") pyflakes
+    ++ stdenv.lib.optional (withProvider "rope") rope
+    ++ stdenv.lib.optional (withProvider "yapf") yapf
+    ++ stdenv.lib.optional isPy27 configparser
+    ++ stdenv.lib.optional (pythonOlder "3.2") futures;
 
-  meta = with lib; {
+  meta = with stdenv.lib; {
     homepage = https://github.com/palantir/python-language-server;
     description = "An implementation of the Language Server Protocol for Python";
     license = licenses.mit;