summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/pyfxa/default.nix32
-rw-r--r--pkgs/development/python-modules/python-language-server/default.nix45
-rw-r--r--pkgs/development/python-modules/tokenserver/default.nix47
3 files changed, 87 insertions, 37 deletions
diff --git a/pkgs/development/python-modules/pyfxa/default.nix b/pkgs/development/python-modules/pyfxa/default.nix
new file mode 100644
index 000000000000..93a74114af19
--- /dev/null
+++ b/pkgs/development/python-modules/pyfxa/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildPythonPackage, fetchPypi
+, requests, cryptography, pybrowserid, hawkauthlib, six
+, grequests, mock, responses, unittest2 }:
+
+buildPythonPackage rec {
+  pname = "PyFxA";
+  version = "0.6.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "d511b6f43a9445587c609a138636d378de76661561116e1f4259fcec9d09b42b";
+  };
+
+  postPatch = ''
+    # Requires network access
+    rm fxa/tests/test_core.py
+  '';
+
+  propagatedBuildInputs = [
+    requests cryptography pybrowserid hawkauthlib six
+  ];
+
+  checkInputs = [
+    grequests mock responses unittest2
+  ];
+
+  meta = with lib; {
+    description = "Firefox Accounts client library for Python";
+    homepage = https://github.com/mozilla/PyFxA;
+    license = licenses.mpl20;
+  };
+}
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;
diff --git a/pkgs/development/python-modules/tokenserver/default.nix b/pkgs/development/python-modules/tokenserver/default.nix
index 44fcb9b46ff9..a07da568dca4 100644
--- a/pkgs/development/python-modules/tokenserver/default.nix
+++ b/pkgs/development/python-modules/tokenserver/default.nix
@@ -1,32 +1,35 @@
-{ buildPythonPackage
-, fetchgit
-, testfixtures
-, cornice
-, mozsvc
-, pybrowserid
-, tokenlib
-, pymysql
-, umemcache
-, hawkauthlib
-, alembic
-, pymysqlsa
-, paste
-, boto
+{ lib, buildPythonPackage, fetchFromGitHub
+, alembic, boto, cornice, hawkauthlib, mozsvc, paste, pybrowserid, pyfxa
+, pymysql, pymysqlsa, sqlalchemy, testfixtures, tokenlib, umemcache
+, mock, nose, unittest2, webtest
 }:
 
 buildPythonPackage rec {
   pname = "tokenserver";
-  version = "1.2.27";
+  version = "1.3.1";
 
-  src = fetchgit {
-    url = https://github.com/mozilla-services/tokenserver.git;
-    rev = "refs/tags/${version}";
-    sha256 = "0il3bgjld495g9gxvvrm56kpan5swaizzg216qz3zxmb6w9ly3fm";
+  src = fetchFromGitHub {
+    owner = "mozilla-services";
+    repo = pname;
+    rev = version;
+    sha256 = "04z0r8xzrmhvh04y8ggdz9gs8qa8lv3qr7kasf6lm63fixsfgrlp";
   };
 
+  propagatedBuildInputs = [
+    alembic boto cornice hawkauthlib mozsvc paste pybrowserid pyfxa
+    pymysql pymysqlsa sqlalchemy testfixtures tokenlib umemcache
+  ];
+
+  checkInputs = [
+    mock nose unittest2 webtest
+  ];
+
+  # Requires virtualenv, MySQL, ...
   doCheck = false;
-  checkInputs = [ testfixtures ];
-  propagatedBuildInputs = [ cornice mozsvc pybrowserid tokenlib
-    pymysql umemcache hawkauthlib alembic pymysqlsa paste boto ];
 
+  meta = with lib; {
+    description = "The Mozilla Token Server";
+    homepage = https://github.com/mozilla-services/tokenserver;
+    license = licenses.mpl20;
+  };
 }