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/Cython/default.nix2
-rw-r--r--pkgs/development/python-modules/Theano/default.nix44
-rw-r--r--pkgs/development/python-modules/acme/default.nix4
-rw-r--r--pkgs/development/python-modules/actdiag/default.nix14
-rw-r--r--pkgs/development/python-modules/amqplib/default.nix1
-rw-r--r--pkgs/development/python-modules/ansi/default.nix8
-rw-r--r--pkgs/development/python-modules/anyjson/default.nix7
-rw-r--r--pkgs/development/python-modules/application/default.nix8
-rw-r--r--pkgs/development/python-modules/area53/default.nix8
-rw-r--r--pkgs/development/python-modules/arxiv2bib/default.nix1
-rw-r--r--pkgs/development/python-modules/asana/default.nix11
-rw-r--r--pkgs/development/python-modules/asgiref/default.nix8
-rw-r--r--pkgs/development/python-modules/basiciw/default.nix30
-rw-r--r--pkgs/development/python-modules/beaker/default.nix43
-rw-r--r--pkgs/development/python-modules/bitbucket-cli/default.nix1
-rw-r--r--pkgs/development/python-modules/browser-cookie3/default.nix24
-rw-r--r--pkgs/development/python-modules/cli-helpers/default.nix59
-rw-r--r--pkgs/development/python-modules/cryptography/default.nix8
-rw-r--r--pkgs/development/python-modules/dbus/default.nix2
-rw-r--r--pkgs/development/python-modules/docrep/default.nix33
-rw-r--r--pkgs/development/python-modules/dominate/default.nix20
-rw-r--r--pkgs/development/python-modules/fastcache/default.nix20
-rw-r--r--pkgs/development/python-modules/fire/default.nix47
-rw-r--r--pkgs/development/python-modules/flask-api/default.nix20
-rw-r--r--pkgs/development/python-modules/flask-bootstrap/default.nix20
-rw-r--r--pkgs/development/python-modules/flask-paginate/default.nix20
-rw-r--r--pkgs/development/python-modules/gensim/default.nix13
-rw-r--r--pkgs/development/python-modules/git-annex-adapter/default.nix19
-rw-r--r--pkgs/development/python-modules/grpcio/default.nix9
-rw-r--r--pkgs/development/python-modules/imgaug/default.nix29
-rw-r--r--pkgs/development/python-modules/ipython/5.nix11
-rw-r--r--pkgs/development/python-modules/jupyterlab/default.nix6
-rw-r--r--pkgs/development/python-modules/keras-applications/default.nix27
-rw-r--r--pkgs/development/python-modules/keras-preprocessing/default.nix27
-rw-r--r--pkgs/development/python-modules/keras/default.nix6
-rw-r--r--pkgs/development/python-modules/ldap/default.nix4
-rw-r--r--pkgs/development/python-modules/marionette-harness/mozlog.nix2
-rw-r--r--pkgs/development/python-modules/markdown/default.nix2
-rw-r--r--pkgs/development/python-modules/mozterm/default.nix4
-rw-r--r--pkgs/development/python-modules/multiprocess/default.nix22
-rw-r--r--pkgs/development/python-modules/mypy-protobuf/default.nix20
-rw-r--r--pkgs/development/python-modules/netdisco/default.nix4
-rw-r--r--pkgs/development/python-modules/orderedset/default.nix18
-rw-r--r--pkgs/development/python-modules/protobuf/default.nix5
-rw-r--r--pkgs/development/python-modules/pycrc/default.nix18
-rw-r--r--pkgs/development/python-modules/pyfxa/default.nix32
-rw-r--r--pkgs/development/python-modules/pygobject/default.nix2
-rw-r--r--pkgs/development/python-modules/pyjwt/default.nix24
-rw-r--r--pkgs/development/python-modules/pyls-black/default.nix32
-rw-r--r--pkgs/development/python-modules/pyls-isort/default.nix4
-rw-r--r--pkgs/development/python-modules/pyls-mypy/default.nix18
-rw-r--r--pkgs/development/python-modules/pymysql/default.nix27
-rw-r--r--pkgs/development/python-modules/pysrim/default.nix30
-rw-r--r--pkgs/development/python-modules/pytest/default.nix4
-rw-r--r--pkgs/development/python-modules/python-language-server/default.nix45
-rw-r--r--pkgs/development/python-modules/pytidylib/default.nix34
-rw-r--r--pkgs/development/python-modules/robotframework/default.nix10
-rw-r--r--pkgs/development/python-modules/robotsuite/default.nix9
-rw-r--r--pkgs/development/python-modules/scapy/default.nix26
-rw-r--r--pkgs/development/python-modules/selenium/default.nix11
-rw-r--r--pkgs/development/python-modules/shippai/default.nix19
-rw-r--r--pkgs/development/python-modules/singledispatch/default.nix27
-rw-r--r--pkgs/development/python-modules/sortedcontainers/default.nix24
-rw-r--r--pkgs/development/python-modules/tensorflow-tensorboard/default.nix9
-rw-r--r--pkgs/development/python-modules/tensorflow/bin.nix27
-rw-r--r--pkgs/development/python-modules/tensorflow/prefetcher.sh3
-rw-r--r--pkgs/development/python-modules/tensorflow/tf1.9.0-hashes.nix34
-rw-r--r--pkgs/development/python-modules/thespian/default.nix4
-rw-r--r--pkgs/development/python-modules/thumbor/default.nix8
-rw-r--r--pkgs/development/python-modules/tokenserver/default.nix47
-rw-r--r--pkgs/development/python-modules/tqdm/default.nix3
-rw-r--r--pkgs/development/python-modules/uuid/default.nix16
-rw-r--r--pkgs/development/python-modules/visitor/default.nix18
-rw-r--r--pkgs/development/python-modules/zeep/default.nix2
74 files changed, 1095 insertions, 163 deletions
diff --git a/pkgs/development/python-modules/Cython/default.nix b/pkgs/development/python-modules/Cython/default.nix
index fa07eee0d7e1..de5eaea842b2 100644
--- a/pkgs/development/python-modules/Cython/default.nix
+++ b/pkgs/development/python-modules/Cython/default.nix
@@ -48,6 +48,8 @@ in buildPythonPackage rec {
         ''--exclude="(${builtins.concatStringsSep "|" excludedTests})"''}
   '';
 
+  doCheck = !stdenv.isDarwin;
+
   patches = [
     # The following is in GitHub in 0.28.3 but not in the `sdist`.
     # https://github.com/cython/cython/issues/2319
diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix
index e2b31cdda794..793488f0b136 100644
--- a/pkgs/development/python-modules/Theano/default.nix
+++ b/pkgs/development/python-modules/Theano/default.nix
@@ -1,8 +1,8 @@
 { stdenv
+, runCommandCC
 , lib
 , fetchPypi
 , gcc
-, writeScriptBin
 , buildPythonPackage
 , isPyPy
 , pythonOlder
@@ -24,19 +24,24 @@ assert cudaSupport -> nvidia_x11 != null
                    && cudnn != null;
 
 let
-  extraFlags =
-    lib.optionals cudaSupport [ "-I ${cudatoolkit}/include" "-L ${cudatoolkit}/lib" ]
-    ++ lib.optionals cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ]
-    ++ lib.optionals cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ];
+  wrapped = command: buildTop: buildInputs:
+    runCommandCC "${command}-wrapped" { inherit buildInputs; } ''
+      type -P '${command}' || { echo '${command}: not found'; exit 1; }
+      cat > "$out" <<EOF
+      #!$(type -P bash)
+      $(declare -xp | sed -e '/^[^=]\+="\('"''${NIX_STORE//\//\\/}"'\|[^\/]\)/!d')
+      declare -x NIX_BUILD_TOP="${buildTop}"
+      $(type -P '${command}') "\$@"
+      EOF
+      chmod +x "$out"
+    '';
 
-  gcc_ = writeScriptBin "g++" ''
-    #!${stdenv.shell}
-    export NIX_CC_WRAPPER_${stdenv.cc.infixSalt}_TARGET_HOST=1
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE ${toString extraFlags}"
-    exec ${gcc}/bin/g++ "$@"
-  '';
+  # Theano spews warnings and disabled flags if the compiler isn't named g++
+  cxx_compiler = wrapped "g++" "\\$HOME/.theano"
+    (    stdenv.lib.optional cudaSupport libgpuarray_
+      ++ stdenv.lib.optional cudnnSupport cudnn );
 
-  libgpuarray_ = libgpuarray.override { inherit cudaSupport; };
+  libgpuarray_ = libgpuarray.override { inherit cudaSupport cudatoolkit; };
 
 in buildPythonPackage rec {
   pname = "Theano";
@@ -50,12 +55,15 @@ in buildPythonPackage rec {
   };
 
   postPatch = ''
-    sed -i 's,g++,${gcc_}/bin/g++,g' theano/configdefaults.py
-  '' + lib.optionalString cudnnSupport ''
-    sed -i \
-      -e "s,ctypes.util.find_library('cudnn'),'${cudnn}/lib/libcudnn.so',g" \
-      -e "s/= _dnn_check_compile()/= (True, None)/g" \
-      theano/gpuarray/dnn.py
+    substituteInPlace theano/configdefaults.py \
+      --replace 'StrParam(param, is_valid=warn_cxx)' 'StrParam('\'''${cxx_compiler}'\''', is_valid=warn_cxx)' \
+      --replace 'rc == 0 and config.cxx != ""' 'config.cxx != ""'
+  '' + stdenv.lib.optionalString cudaSupport ''
+    substituteInPlace theano/configdefaults.py \
+      --replace 'StrParam(get_cuda_root)' 'StrParam('\'''${cudatoolkit}'\''')'
+  '' + stdenv.lib.optionalString cudnnSupport ''
+    substituteInPlace theano/configdefaults.py \
+      --replace 'StrParam(default_dnn_base_path)' 'StrParam('\'''${cudnn}'\''')'
   '';
 
   preCheck = ''
diff --git a/pkgs/development/python-modules/acme/default.nix b/pkgs/development/python-modules/acme/default.nix
index 820ee2a95d81..503c6f796591 100644
--- a/pkgs/development/python-modules/acme/default.nix
+++ b/pkgs/development/python-modules/acme/default.nix
@@ -27,4 +27,8 @@ buildPythonPackage rec {
   checkInputs = [ nose ];
 
   postUnpack = "sourceRoot=\${sourceRoot}/acme";
+
+  meta = certbot.meta // {
+    description = "ACME protocol implementation in Python";
+  };
 }
diff --git a/pkgs/development/python-modules/actdiag/default.nix b/pkgs/development/python-modules/actdiag/default.nix
index 2172aa1165a6..27a9a455c47f 100644
--- a/pkgs/development/python-modules/actdiag/default.nix
+++ b/pkgs/development/python-modules/actdiag/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, buildPythonPackage, fetchPypi
-, pep8, nose, unittest2, docutils, blockdiag  }:
+{ stdenv, buildPythonPackage, fetchPypi, fetchpatch
+, pep8, nose, unittest2, docutils, blockdiag, reportlab }:
 
 buildPythonPackage rec {
   pname = "actdiag";
@@ -10,13 +10,17 @@ buildPythonPackage rec {
     sha256 = "983071777d9941093aaef3be1f67c198a8ac8d2bba264cdd1f337ca415ab46af";
   };
 
+  patches = fetchpatch {
+    name = "drop_test_pep8.py.patch";
+    url = https://bitbucket.org/blockdiag/actdiag/commits/c1f2ed5947a1e93291f5860e4e30cee098bd635d/raw;
+    sha256 = "1zxzwb0fvwlc8xgs45fx65341sjhb3h6l2p6rdj6i127vg1hsxb4";
+  };
+
   buildInputs = [ pep8 nose unittest2 docutils ];
 
   propagatedBuildInputs = [ blockdiag ];
 
-  # One test fails:
-  #   UnicodeEncodeError: 'ascii' codec can't encode character u'\u3042' in position 0: ordinal not in range(128)
-  doCheck = false;
+  checkInputs = [ reportlab ];
 
   meta = with stdenv.lib; {
     description = "Generate activity-diagram image from spec-text file (similar to Graphviz)";
diff --git a/pkgs/development/python-modules/amqplib/default.nix b/pkgs/development/python-modules/amqplib/default.nix
index 37f1e395d8de..3699fdd5d499 100644
--- a/pkgs/development/python-modules/amqplib/default.nix
+++ b/pkgs/development/python-modules/amqplib/default.nix
@@ -15,5 +15,6 @@ buildPythonPackage rec {
   meta = with stdenv.lib; {
     homepage = http://code.google.com/p/py-amqplib/;
     description = "Python client for the Advanced Message Queuing Procotol (AMQP)";
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/python-modules/ansi/default.nix b/pkgs/development/python-modules/ansi/default.nix
index a79de55d2eb0..77b93ce890e4 100644
--- a/pkgs/development/python-modules/ansi/default.nix
+++ b/pkgs/development/python-modules/ansi/default.nix
@@ -1,4 +1,4 @@
-{ buildPythonPackage, fetchPypi }:
+{ lib, buildPythonPackage, fetchPypi }:
 
 buildPythonPackage rec {
   pname = "ansi";
@@ -12,4 +12,10 @@ buildPythonPackage rec {
   checkPhase = ''
     python -c "import ansi.color"
   '';
+
+  meta = with lib; {
+    description = "ANSI cursor movement and graphics";
+    homepage = https://github.com/tehmaze/ansi/;
+    license = licenses.mit;
+  };
 }
diff --git a/pkgs/development/python-modules/anyjson/default.nix b/pkgs/development/python-modules/anyjson/default.nix
index 6db4bbdc3148..65476b47f8fd 100644
--- a/pkgs/development/python-modules/anyjson/default.nix
+++ b/pkgs/development/python-modules/anyjson/default.nix
@@ -1,4 +1,4 @@
-{ buildPythonPackage, fetchPypi, isPy3k, nose }:
+{ lib, buildPythonPackage, fetchPypi, isPy3k, nose }:
 
 buildPythonPackage rec {
   pname = "anyjson";
@@ -14,8 +14,9 @@ buildPythonPackage rec {
 
   buildInputs = [ nose ];
 
-  meta = {
-    homepage = https://pypi.python.org/pypi/anyjson/;
+  meta = with lib; {
+    homepage = https://bitbucket.org/runeh/anyjson/;
     description = "Wrapper that selects the best available JSON implementation";
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/python-modules/application/default.nix b/pkgs/development/python-modules/application/default.nix
index 584eb3ae2c52..520e01723e6c 100644
--- a/pkgs/development/python-modules/application/default.nix
+++ b/pkgs/development/python-modules/application/default.nix
@@ -1,4 +1,4 @@
-{ buildPythonPackage, fetchdarcs, zope_interface, isPy3k }:
+{ lib, buildPythonPackage, fetchdarcs, zope_interface, isPy3k }:
 
 buildPythonPackage rec {
   pname = "python-application";
@@ -12,4 +12,10 @@ buildPythonPackage rec {
   };
 
   buildInputs = [ zope_interface ];
+
+  meta = with lib; {
+    description = "Basic building blocks for python applications";
+    homepage = https://github.com/AGProjects/python-application;
+    license = licenses.lgpl2Plus;
+  };
 }
diff --git a/pkgs/development/python-modules/area53/default.nix b/pkgs/development/python-modules/area53/default.nix
index 20013b8a1ed4..cd8e83dbf630 100644
--- a/pkgs/development/python-modules/area53/default.nix
+++ b/pkgs/development/python-modules/area53/default.nix
@@ -1,4 +1,4 @@
-{ buildPythonPackage, fetchPypi
+{ lib, buildPythonPackage, fetchPypi
 , boto }:
 
 buildPythonPackage rec {
@@ -14,4 +14,10 @@ buildPythonPackage rec {
   doCheck = false;
 
   propagatedBuildInputs = [ boto ];
+
+  meta = with lib; {
+    description = "Python Interface to Route53";
+    homepage = https://github.com/mariusv/Area53;
+    license = licenses.unfree; # unspecified
+  };
 }
diff --git a/pkgs/development/python-modules/arxiv2bib/default.nix b/pkgs/development/python-modules/arxiv2bib/default.nix
index 1182c36fc0ca..99725bcfa61d 100644
--- a/pkgs/development/python-modules/arxiv2bib/default.nix
+++ b/pkgs/development/python-modules/arxiv2bib/default.nix
@@ -14,7 +14,6 @@ buildPythonPackage rec {
     sha256 = "1kp2iyx20lpc9dv4qg5fgwf83a1wx6f7hj1ldqyncg0kn9xcrhbg";
   };
 
-  # Required for tests only
   checkInputs = [ mock ];
 
   checkPhase = "${python.interpreter} -m unittest discover -s tests";
diff --git a/pkgs/development/python-modules/asana/default.nix b/pkgs/development/python-modules/asana/default.nix
index 2fbe4932beda..19140925595b 100644
--- a/pkgs/development/python-modules/asana/default.nix
+++ b/pkgs/development/python-modules/asana/default.nix
@@ -4,22 +4,21 @@
 
 buildPythonPackage rec {
   pname = "asana";
-  version = "0.7.0";
+  version = "0.7.1";
 
   src = fetchFromGitHub {
     owner = "asana";
     repo = "python-asana";
     rev = "v${version}";
-    sha256 = "0786y3wxqxxhsb0kkpx4bfzif3dhvv3dmm6vnq58iyj94862kpxf";
+    sha256 = "0vmpy4j1n54gkkg0l8bhw0xf4yby5kqzxnsv07cjc2w38snj5vy1";
   };
 
   checkInputs = [ pytest responses ];
   propagatedBuildInputs = [ requests requests_oauthlib six ];
 
-  patchPhase = ''
-    echo > requirements.txt
-    sed -i "s/requests~=2.9.1/requests >=2.9.1/" setup.py
-    sed -i "s/requests_oauthlib~=0.6.1/requests_oauthlib >=0.6.1/" setup.py
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "requests_oauthlib >= 0.8.0, == 0.8.*" "requests_oauthlib>=0.8.0<2.0"
   '';
 
   checkPhase = ''
diff --git a/pkgs/development/python-modules/asgiref/default.nix b/pkgs/development/python-modules/asgiref/default.nix
index a556cd3c87f2..155ddf8c9f8b 100644
--- a/pkgs/development/python-modules/asgiref/default.nix
+++ b/pkgs/development/python-modules/asgiref/default.nix
@@ -1,14 +1,16 @@
-{ stdenv, buildPythonPackage, fetchFromGitHub, async-timeout, pytest, pytest-asyncio }:
+{ stdenv, buildPythonPackage, pythonOlder, fetchFromGitHub, async-timeout, pytest, pytest-asyncio }:
 buildPythonPackage rec {
-  version = "2.2.0";
+  version = "2.3.2";
   pname = "asgiref";
 
+  disabled = pythonOlder "3.5";
+
   # PyPI tarball doesn't include tests directory
   src = fetchFromGitHub {
     owner = "django";
     repo = pname;
     rev = version;
-    sha256 = "0jsdkgwzswm1jbfm6d100yfvfzpic8v6ysydcnn798bbpwclj8ip";
+    sha256 = "1ljymmcscyp3bz33kjbhf99k04fbama87vg4069gbgj6lnxjpzav";
   };
 
   propagatedBuildInputs = [ async-timeout ];
diff --git a/pkgs/development/python-modules/basiciw/default.nix b/pkgs/development/python-modules/basiciw/default.nix
new file mode 100644
index 000000000000..0d25d7cdbe98
--- /dev/null
+++ b/pkgs/development/python-modules/basiciw/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, gcc
+, wirelesstools
+, isPy27
+, isPyPy
+}:
+
+buildPythonPackage rec {
+  pname = "basiciw";
+  version = "0.2.2";
+
+  disabled = isPy27 || isPyPy;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1ajmflvvlkflrcmqmkrx0zaira84z8kv4ssb2jprfwvjh8vfkysb";
+  };
+
+  buildInputs = [ gcc ];
+  propagatedBuildInputs = [ wirelesstools ];
+
+  meta = {
+    description = "Get info about wireless interfaces using libiw";
+    homepage = https://github.com/enkore/basiciw;
+    platforms = lib.platforms.linux;
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/development/python-modules/beaker/default.nix b/pkgs/development/python-modules/beaker/default.nix
new file mode 100644
index 000000000000..7a17fd0f1d0a
--- /dev/null
+++ b/pkgs/development/python-modules/beaker/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, nose
+, mock
+, webtest
+, sqlalchemy
+, pycrypto
+, isPy27
+, funcsigs
+, pycryptopp
+}:
+
+buildPythonPackage rec {
+  pname = "Beaker";
+  version = "1.8.0";
+
+  # The pypy release do not contains the tests
+  src = fetchFromGitHub {
+    owner = "bbangert";
+    repo = "beaker";
+    rev = "${version}";
+    sha256 = "17yfr7a307n8rdl09was4j60xqk2s0hk0hywdkigrpj4qnw0is7g";
+  };
+
+  buildInputs =
+    [ nose
+      mock
+      webtest
+    ];
+  propagatedBuildInputs = [
+    sqlalchemy
+    pycrypto
+  ] ++ lib.optionals (isPy27) [
+    funcsigs
+    pycryptopp
+  ];
+
+  meta = {
+    description = "A Session and Caching library with WSGI Middleware";
+    maintainers = with lib.maintainers; [ garbas domenkozar ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/bitbucket-cli/default.nix b/pkgs/development/python-modules/bitbucket-cli/default.nix
index b5d115f4d0bb..0a54c0ed17c3 100644
--- a/pkgs/development/python-modules/bitbucket-cli/default.nix
+++ b/pkgs/development/python-modules/bitbucket-cli/default.nix
@@ -19,5 +19,6 @@ buildPythonPackage rec {
     description = "Bitbucket command line interface";
     homepage = https://bitbucket.org/zhemao/bitbucket-cli;
     maintainers = with maintainers; [ refnil ];
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/python-modules/browser-cookie3/default.nix b/pkgs/development/python-modules/browser-cookie3/default.nix
new file mode 100644
index 000000000000..64510ee5b640
--- /dev/null
+++ b/pkgs/development/python-modules/browser-cookie3/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchPypi, buildPythonPackage, isPy3k, keyring, pbkdf2, pyaes}:
+buildPythonPackage rec {
+  pname = "browser-cookie3";
+  version = "0.6.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "16nghwsrv08gz4iiyxsy5lgg5ljgrwkp471m7xnsvhhpb3axmnsc";
+  };
+
+  disabled = !isPy3k;
+
+  propagatedBuildInputs = [ keyring pbkdf2 pyaes ];
+
+  # No tests implemented
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Loads cookies from your browser into a cookiejar object";
+    maintainers = with maintainers; [ borisbabic ];
+    homepage = https://github.com/borisbabic/browser_cookie3;
+    license = licenses.gpl3;
+  };
+}
diff --git a/pkgs/development/python-modules/cli-helpers/default.nix b/pkgs/development/python-modules/cli-helpers/default.nix
new file mode 100644
index 000000000000..69b811a94f4f
--- /dev/null
+++ b/pkgs/development/python-modules/cli-helpers/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, terminaltables
+, tabulate
+, backports_csv
+, wcwidth
+, pytest
+, isPy27
+}:
+
+buildPythonPackage rec {
+  pname = "cli_helpers";
+  version = "1.0.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1z5rqm8pznj6bvivm2al8rsxm82rai8hc9bqrgh3ksnbzg2kfy7p";
+  };
+
+  propagatedBuildInputs = [
+    terminaltables
+    tabulate
+    wcwidth
+  ] ++ (lib.optionals isPy27 [ backports_csv ]);
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = with lib; {
+    description = "Python helpers for common CLI tasks";
+    longDescription = ''
+      CLI Helpers is a Python package that makes it easy to perform common
+      tasks when building command-line apps. It's a helper library for
+      command-line interfaces.
+
+      Libraries like Click and Python Prompt Toolkit are amazing tools that
+      help you create quality apps. CLI Helpers complements these libraries by
+      wrapping up common tasks in simple interfaces.
+
+      CLI Helpers is not focused on your app's design pattern or framework --
+      you can use it on its own or in combination with other libraries. It's
+      lightweight and easy to extend.
+
+      What's included in CLI Helpers?
+
+      - Prettyprinting of tabular data with custom pre-processing
+      - [in progress] config file reading/writing
+
+      Read the documentation at http://cli-helpers.rtfd.io
+    '';
+    homepage = https://cli-helpers.readthedocs.io/en/stable/;
+    license = licenses.bsd3 ;
+    maintainers = [ maintainers.kalbasit ];
+  };
+}
diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix
index 2a8736e29de3..52244ae4d961 100644
--- a/pkgs/development/python-modules/cryptography/default.nix
+++ b/pkgs/development/python-modules/cryptography/default.nix
@@ -20,12 +20,10 @@
 , hypothesis
 }:
 
-let
-  version = "2.3";
-in assert version == cryptography_vectors.version; buildPythonPackage rec {
+buildPythonPackage rec {
   # also bump cryptography_vectors
   pname = "cryptography";
-  inherit version;
+  version = "2.3";
 
   src = fetchPypi {
     inherit pname version;
@@ -64,4 +62,4 @@ in assert version == cryptography_vectors.version; buildPythonPackage rec {
   # IOKit's dependencies are inconsistent between OSX versions, so this is the best we
   # can do until nix 1.11's release
   __impureHostDeps = [ "/usr/lib" ];
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/dbus/default.nix b/pkgs/development/python-modules/dbus/default.nix
index 8f3f331fd509..13465f1af2c8 100644
--- a/pkgs/development/python-modules/dbus/default.nix
+++ b/pkgs/development/python-modules/dbus/default.nix
@@ -15,12 +15,12 @@ if isPyPy then throw "dbus-python not supported for interpreter ${python.executa
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ dbus dbus-glib ]
-    ++ lib.optionals doCheck [ dbus.out pygobject3 ]
     # My guess why it's sometimes trying to -lncurses.
     # It seems not to retain the dependency anyway.
     ++ lib.optional (! python ? modules) ncurses;
 
   doCheck = true;
+  checkInputs = [ dbus.out pygobject3 ];
 
   meta = {
     description = "Python DBus bindings";
diff --git a/pkgs/development/python-modules/docrep/default.nix b/pkgs/development/python-modules/docrep/default.nix
new file mode 100644
index 000000000000..e2bde245a678
--- /dev/null
+++ b/pkgs/development/python-modules/docrep/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "docrep";
+  version = "0.2.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "7d195b6dfcf4efe5cb65402b6c6f6d7e6db77ce255887fae32c9a8288a022659";
+  };
+
+  checkInputs = [ pytest ];
+  propagatedBuildInputs = [ six ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  # tests not packaged with PyPi download
+  doCheck = false;
+
+  meta = {
+    description = "Python package for docstring repetition";
+    homepage = https://github.com/Chilipp/docrep;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ costrouc ];
+  };
+}
diff --git a/pkgs/development/python-modules/dominate/default.nix b/pkgs/development/python-modules/dominate/default.nix
new file mode 100644
index 000000000000..86b3271990d5
--- /dev/null
+++ b/pkgs/development/python-modules/dominate/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildPythonPackage, fetchPypi, isPy3k }:
+
+buildPythonPackage rec {
+  pname = "dominate";
+  version = "2.3.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0s9s9j9xmhkzw7apqx170fyvc0f800fd4a5jfn8xvj9k6vryd32b";
+  };
+
+  doCheck = !isPy3k;
+
+  meta = with lib; {
+    homepage = https://github.com/Knio/dominate/;
+    description = "Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/pkgs/development/python-modules/fastcache/default.nix b/pkgs/development/python-modules/fastcache/default.nix
new file mode 100644
index 000000000000..5638e8412b56
--- /dev/null
+++ b/pkgs/development/python-modules/fastcache/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildPythonPackage, fetchPypi, pytest }:
+
+buildPythonPackage rec {
+  pname = "fastcache";
+  version = "1.0.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1rl489zfbm2x67n7i6r7r4nhrhwk6yz3yc7x9y2rky8p95vhaw46";
+  };
+
+  checkInputs = [ pytest ];
+
+  meta = with lib; {
+    description = "C implementation of Python3 lru_cache for Python 2 and 3";
+    homepage = https://github.com/pbrady/fastcache;
+    license = licenses.mit;
+    maintainers = [ maintainers.bhipple ];
+  };
+}
diff --git a/pkgs/development/python-modules/fire/default.nix b/pkgs/development/python-modules/fire/default.nix
new file mode 100644
index 000000000000..70538407f2ee
--- /dev/null
+++ b/pkgs/development/python-modules/fire/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, six, hypothesis, mock
+, python-Levenshtein, pytest }:
+
+buildPythonPackage rec {
+  pname = "fire";
+  version = "0.1.3";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "python-fire";
+    rev = "v${version}";
+    sha256 = "0kdcmzr3sgzjsw5fmvdylgrn8akqjbs433jbgqzp498njl9cc6qx";
+  };
+
+  propagatedBuildInputs = [ six ];
+
+  checkInputs = [ hypothesis mock python-Levenshtein pytest ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+
+  meta = with stdenv.lib; {
+    description = "A library for automatically generating command line interfaces";
+    longDescription = ''
+      Python Fire is a library for automatically generating command line
+      interfaces (CLIs) from absolutely any Python object.
+
+      * Python Fire is a simple way to create a CLI in Python.
+
+      * Python Fire is a helpful tool for developing and debugging
+        Python code.
+
+      * Python Fire helps with exploring existing code or turning other
+        people's code into a CLI.
+
+      * Python Fire makes transitioning between Bash and Python easier.
+
+      * Python Fire makes using a Python REPL easier by setting up the
+        REPL with the modules and variables you'll need already imported
+        and created.
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ leenaars ];
+  };
+}
diff --git a/pkgs/development/python-modules/flask-api/default.nix b/pkgs/development/python-modules/flask-api/default.nix
new file mode 100644
index 000000000000..cee93a759200
--- /dev/null
+++ b/pkgs/development/python-modules/flask-api/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildPythonPackage, fetchPypi, flask, markdown }:
+
+buildPythonPackage rec {
+  pname = "Flask-API";
+  version = "1.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0dffcy2hdkajbvl2wkz9dam49v05x9d87cf2mh2cyvza2c5ah47w";
+  };
+
+  propagatedBuildInputs = [ flask markdown ];
+
+  meta = with lib; {
+    homepage = https://github.com/miracle2k/flask-assets;
+    description = "Browsable web APIs for Flask";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/pkgs/development/python-modules/flask-bootstrap/default.nix b/pkgs/development/python-modules/flask-bootstrap/default.nix
new file mode 100644
index 000000000000..7c12b79bb2f3
--- /dev/null
+++ b/pkgs/development/python-modules/flask-bootstrap/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildPythonPackage, fetchPypi, flask, visitor, dominate }:
+
+buildPythonPackage rec {
+  pname = "Flask-Bootstrap";
+  version = "3.3.7.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1j1s2bplaifsnmr8vfxa3czca4rz78xyhrg4chx39xl306afs26b";
+  };
+
+  propagatedBuildInputs = [ flask visitor dominate ];
+
+  meta = with lib; {
+    homepage = https://github.com/mbr/flask-bootstrap;
+    description = "Ready-to-use Twitter-bootstrap for use in Flask.";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/pkgs/development/python-modules/flask-paginate/default.nix b/pkgs/development/python-modules/flask-paginate/default.nix
new file mode 100644
index 000000000000..7af4aa2b8dd4
--- /dev/null
+++ b/pkgs/development/python-modules/flask-paginate/default.nix
@@ -0,0 +1,20 @@
+{ lib, buildPythonPackage, fetchPypi, flask }:
+
+buildPythonPackage rec {
+  pname = "flask-paginate";
+  version = "0.5.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0pgk6ngqzh7lgq2nr6hraqp3z76f3f0kjhai50vxb6j1civ8v3mn";
+  };
+
+  propagatedBuildInputs = [ flask ];
+
+  meta = with lib; {
+    homepage = https://github.com/lixxu/flask-paginate;
+    description = "Pagination support for Flask";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/pkgs/development/python-modules/gensim/default.nix b/pkgs/development/python-modules/gensim/default.nix
index f9f8198e4ac1..9a1a870dd00a 100644
--- a/pkgs/development/python-modules/gensim/default.nix
+++ b/pkgs/development/python-modules/gensim/default.nix
@@ -5,6 +5,7 @@
 , six
 , scipy
 , smart_open
+, scikitlearn, testfixtures, unittest2
 }:
 
 buildPythonPackage rec {
@@ -15,20 +16,20 @@ buildPythonPackage rec {
     sha256 = "78ed9b6ac35f104542f3bee0386d71ddf9432d74c153065d2ea9f6baf10e5b49";
   };
 
-  propagatedBuildInputs = [ smart_open numpy six scipy
-                            # scikitlearn testfixtures unittest2 # for tests
-                          ];
-  doCheck = false;
+  propagatedBuildInputs = [ smart_open numpy six scipy ];
 
-  # Two tests fail.
+  checkInputs = [ scikitlearn testfixtures unittest2 ];
 
+  # Two tests fail.
+  #
   # ERROR: testAddMorphemesToEmbeddings (gensim.test.test_varembed_wrapper.TestVarembed)
   # ImportError: Could not import morfessor.
   # This package is not in nix
-
+  #
   # ERROR: testWmdistance (gensim.test.test_fasttext_wrapper.TestFastText)
   # ImportError: Please install pyemd Python package to compute WMD.
   # This package is not in nix
+  doCheck = false;
 
   meta = {
     description = "Topic-modelling library";
diff --git a/pkgs/development/python-modules/git-annex-adapter/default.nix b/pkgs/development/python-modules/git-annex-adapter/default.nix
index 6cb6e626f279..935217c6992e 100644
--- a/pkgs/development/python-modules/git-annex-adapter/default.nix
+++ b/pkgs/development/python-modules/git-annex-adapter/default.nix
@@ -22,13 +22,30 @@ buildPythonPackage rec {
       --replace "'git-annex'" "'${git-annex}/bin/git-annex'"
   '';
 
-  # TODO: Remove for next version
   patches = [
+    # fixes the "not-a-git-repo" testcase where recent git versions expect a slightly different error.
     ./not-a-git-repo-testcase.patch
+
+    # fixes the testcase which parses the output of `git-annex info` where several
+    # new lines are displayed that broke the test.
+    (fetchpatch {
+      url = "https://github.com/Ma27/git-annex-adapter/commit/39cb6da69c1aec3d57ea9f68c2dea5113ae1b764.patch";
+      sha256 = "0wyy2icqan3jpiw7dm50arfq3mgq4b5s3g91k82srap763r9hg5m";
+    })
+
+    # fixes the testcase which runs "git status" and complies with the
+    # slightly altered output.
     (fetchpatch {
       url = "https://github.com/alpernebbi/git-annex-adapter/commit/9f64c4b99cae7b681820c6c7382e1e40489f4d1e.patch";
       sha256 = "0yh66gial6bx7kbl7s7lkzljnkpgvgr8yahqqcq9z76d0w752dir";
     })
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    # `rev` is part of utillinux on NixOS which is not available on `nixpks` for darwin:
+    # https://logs.nix.ci/?key=nixos/nixpkgs.45061&attempt_id=271763ba-2ae7-4098-b469-b82b1d8edb9b
+    (fetchpatch {
+      url = "https://github.com/alpernebbi/git-annex-adapter/commit/0b60b4577528b309f6ac9d47b55a00dbda9850ea.patch";
+      sha256 = "0z608hpmyzv1mm01dxr7d6bi1hc77h4yafghkynmv99ijgnm1qk7";
+    })
   ];
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/grpcio/default.nix b/pkgs/development/python-modules/grpcio/default.nix
index 1846c7bcd896..204080fe115e 100644
--- a/pkgs/development/python-modules/grpcio/default.nix
+++ b/pkgs/development/python-modules/grpcio/default.nix
@@ -1,6 +1,7 @@
-{ stdenv, buildPythonPackage, fetchPypi, lib
-, six, protobuf, enum34, futures, isPy27, isPy34 }:
+{ stdenv, buildPythonPackage, fetchPypi, lib, darwin
+, six, protobuf, enum34, futures, isPy27, isPy34, pkgconfig }:
 
+with stdenv.lib;
 buildPythonPackage rec {
   pname = "grpcio";
   version = "1.13.0";
@@ -10,10 +11,14 @@ buildPythonPackage rec {
     sha256 = "6324581e215157f0fbe335dff2e21a65b4406db98ac7cca05f1e23b4f510b426";
   };
 
+  nativeBuildInputs = [ pkgconfig ] ++ optional stdenv.isDarwin darwin.cctools;
+
   propagatedBuildInputs = [ six protobuf ]
                         ++ lib.optionals (isPy27 || isPy34) [ enum34 ]
                         ++ lib.optionals (isPy27) [ futures ];
 
+  preBuild = optionalString stdenv.isDarwin "unset AR";
+
   meta = with stdenv.lib; {
     description = "HTTP/2-based RPC framework";
     license = lib.licenses.asl20;
diff --git a/pkgs/development/python-modules/imgaug/default.nix b/pkgs/development/python-modules/imgaug/default.nix
new file mode 100644
index 000000000000..08f1d49d8c6c
--- /dev/null
+++ b/pkgs/development/python-modules/imgaug/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, buildPythonPackage, fetchPypi, numpy, scipy, scikitimage, opencv3, six }:
+
+buildPythonPackage rec {
+  pname = "imgaug";
+  version = "0.2.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1wy8ydkqq0jrwxwdv04q89n3gwsr9pjaspsbw26ipg5a5lnhb9c2";
+  };
+
+  propagatedBuildInputs = [
+    numpy
+    scipy
+    scikitimage
+    opencv3
+    six
+  ];
+
+  # disable tests when there are no tests in the PyPI archive
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/aleju/imgaug;
+    description = "Image augmentation for machine learning experiments";
+    license = licenses.mit;
+    maintainers = with maintainers; [ cmcdragonkai ];
+  };
+}
diff --git a/pkgs/development/python-modules/ipython/5.nix b/pkgs/development/python-modules/ipython/5.nix
index f2066fee2a4a..36f581c98afb 100644
--- a/pkgs/development/python-modules/ipython/5.nix
+++ b/pkgs/development/python-modules/ipython/5.nix
@@ -2,6 +2,7 @@
 , stdenv
 , buildPythonPackage
 , fetchPypi
+, fetchpatch
 # Build dependencies
 , glibcLocales
 # Test dependencies
@@ -36,6 +37,16 @@ buildPythonPackage rec {
     substituteInPlace setup.py --replace "'gnureadline'" " "
   '';
 
+  patches = [
+    # improve cython support, needed by sage, accepted upstream
+    # https://github.com/ipython/ipython/pull/11139
+    (fetchpatch {
+      name = "signature-use-inspect.patch";
+      url = "https://github.com/ipython/ipython/commit/8d399b98d3ed5c765835594100c4d36fb2f739dc.patch";
+      sha256 = "1r7v9clwwbskmj4y160vcj6g0vzqbvnj4y1bm2n4bskafapm42g0";
+    })
+  ];
+
   buildInputs = [ glibcLocales ];
 
   checkInputs = [ nose pygments testpath ] ++ lib.optional isPy27 mock;
diff --git a/pkgs/development/python-modules/jupyterlab/default.nix b/pkgs/development/python-modules/jupyterlab/default.nix
index 64485085d1a8..e47fdfa15ba2 100644
--- a/pkgs/development/python-modules/jupyterlab/default.nix
+++ b/pkgs/development/python-modules/jupyterlab/default.nix
@@ -1,12 +1,12 @@
 { lib, buildPythonPackage, isPy3k, fetchPypi, ipython_genutils, jupyterlab_launcher, notebook }:
 buildPythonPackage rec {
   pname = "jupyterlab";
-  version = "0.32.1";
+  version = "0.33.7";
   disabled = !isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "88290656a2db2e38ef913a257ec283f3b5bd99144ed3d52899c9af7030077554";
+    sha256 = "ab9f7bcbc3b4e107897f368aa0527cdc1b4ccf0c370e218ae03ac1d75fac261c";
   };
 
   propagatedBuildInputs = [
@@ -26,6 +26,6 @@ buildPythonPackage rec {
     description = "Jupyter lab environment notebook server extension.";
     license = with licenses; [ bsd3 ];
     homepage = "http://jupyter.org/";
-    maintainers = with maintainers; [ zimbatm ];
+    maintainers = with maintainers; [ zimbatm costrouc ];
   };
 }
diff --git a/pkgs/development/python-modules/keras-applications/default.nix b/pkgs/development/python-modules/keras-applications/default.nix
new file mode 100644
index 000000000000..e06a0b75b504
--- /dev/null
+++ b/pkgs/development/python-modules/keras-applications/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildPythonPackage, fetchPypi, numpy, h5py }:
+
+buildPythonPackage rec {
+  pname = "Keras_Applications";
+  version = "1.0.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "8c95300328630ae74fb0828b6fa38269a25c0228a02f1e5181753bfd48961f49";
+  };
+
+  # Cyclic dependency: keras-applications requires keras, which requires keras-applications
+  postPatch = ''
+    sed -i "s/keras>=[^']*//" setup.py
+  '';
+
+  # No tests in PyPI tarball
+  doCheck = false;
+
+  propagatedBuildInputs = [ numpy h5py ];
+
+  meta = with lib; {
+    description = "Reference implementations of popular deep learning models";
+    homepage = https://github.com/keras-team/keras-applications;
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/keras-preprocessing/default.nix b/pkgs/development/python-modules/keras-preprocessing/default.nix
new file mode 100644
index 000000000000..043e43eb1843
--- /dev/null
+++ b/pkgs/development/python-modules/keras-preprocessing/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildPythonPackage, fetchPypi, numpy, scipy, six }:
+
+buildPythonPackage rec {
+  pname = "Keras_Preprocessing";
+  version = "1.0.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "f5306554d2b454d825b36f35e327744f5477bd2ae21017f1a93b2097bed6757e";
+  };
+
+  # Cyclic dependency: keras-preprocessing requires keras, which requires keras-preprocessing
+  postPatch = ''
+    sed -i "s/keras>=[^']*//" setup.py
+  '';
+
+  # No tests in PyPI tarball
+  doCheck = false;
+
+  propagatedBuildInputs = [ numpy scipy six ];
+
+  meta = with lib; {
+    description = "Easy data preprocessing and data augmentation for deep learning models";
+    homepage = https://github.com/keras-team/keras-preprocessing;
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix
index 3b221238f3af..ea699c9c04a9 100644
--- a/pkgs/development/python-modules/keras/default.nix
+++ b/pkgs/development/python-modules/keras/default.nix
@@ -1,15 +1,16 @@
 { stdenv, buildPythonPackage, fetchPypi
 , pytest, pytestcov, pytestpep8, pytest_xdist
 , six, numpy, scipy, pyyaml, h5py
+, keras-applications, keras-preprocessing
 }:
 
 buildPythonPackage rec {
   pname = "Keras";
-  version = "2.2.0";
+  version = "2.2.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "5b8499d157af217f1a5ee33589e774127ebc3e266c833c22cb5afbb0ed1734bf";
+    sha256 = "468d98da104ec5c3dbb10c2ef6bb345ab154f6ca2d722d4c250ef4d6105de17a";
   };
 
   checkInputs = [
@@ -21,6 +22,7 @@ buildPythonPackage rec {
 
   propagatedBuildInputs = [
     six pyyaml numpy scipy h5py
+    keras-applications keras-preprocessing
   ];
 
   # Couldn't get tests working
diff --git a/pkgs/development/python-modules/ldap/default.nix b/pkgs/development/python-modules/ldap/default.nix
index 17a6b158d3f2..09d399d25b37 100644
--- a/pkgs/development/python-modules/ldap/default.nix
+++ b/pkgs/development/python-modules/ldap/default.nix
@@ -1,6 +1,6 @@
 { buildPythonPackage, fetchPypi
 , pyasn1, pyasn1-modules, pytest
-, openldap, cyrus_sasl }:
+, openldap, cyrus_sasl, stdenv }:
 
 buildPythonPackage rec {
   pname = "python-ldap";
@@ -26,4 +26,6 @@ buildPythonPackage rec {
 
     py.test
   '';
+
+  doCheck = !stdenv.isDarwin;
 }
diff --git a/pkgs/development/python-modules/marionette-harness/mozlog.nix b/pkgs/development/python-modules/marionette-harness/mozlog.nix
index ce24fd48dd4b..b8d0c077d664 100644
--- a/pkgs/development/python-modules/marionette-harness/mozlog.nix
+++ b/pkgs/development/python-modules/marionette-harness/mozlog.nix
@@ -16,7 +16,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "af3a3252bc58f8642a641601ba59096c22e4aa49cdc1ed4b0df2314f4f027f0d";
+    sha256 = "00x28z6diw06gakb5isbfha5z2n63yyncv4za303nsgzxvlihmx0";
   };
 
   propagatedBuildInputs = [ blessings mozterm six ];
diff --git a/pkgs/development/python-modules/markdown/default.nix b/pkgs/development/python-modules/markdown/default.nix
index 515dee0e7662..f2397138771e 100644
--- a/pkgs/development/python-modules/markdown/default.nix
+++ b/pkgs/development/python-modules/markdown/default.nix
@@ -25,4 +25,4 @@ buildPythonPackage rec {
     homepage = https://github.com/Python-Markdown/markdown;
     license = lib.licenses.bsd3;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/mozterm/default.nix b/pkgs/development/python-modules/mozterm/default.nix
index 358b21893fa6..c7f2b4cbc349 100644
--- a/pkgs/development/python-modules/mozterm/default.nix
+++ b/pkgs/development/python-modules/mozterm/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildPythonPackage, fetchPypi, isPy3k }:
+{ lib, buildPythonPackage, fetchPypi, isPy3k, six }:
 
 buildPythonPackage rec {
   pname = "mozterm";
@@ -7,6 +7,8 @@ buildPythonPackage rec {
   # name 'unicode' is not defined
   disabled = isPy3k;
 
+  propagatedBuildInputs = [six];
+
   src = fetchPypi {
     inherit pname version;
     sha256 = "b1e91acec188de07c704dbb7b0100a7be5c1e06567b3beb67f6ea11d00a483a4";
diff --git a/pkgs/development/python-modules/multiprocess/default.nix b/pkgs/development/python-modules/multiprocess/default.nix
new file mode 100644
index 000000000000..c5c53577505c
--- /dev/null
+++ b/pkgs/development/python-modules/multiprocess/default.nix
@@ -0,0 +1,22 @@
+{ lib, buildPythonPackage, fetchPypi, dill }:
+
+buildPythonPackage rec {
+  pname = "multiprocess";
+  version = "0.70.6.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1ip5caz67b3q0553mr8gm8xwsb8x500jn8ml0gihgyfy52m2ypcq";
+  };
+
+  propagatedBuildInputs = [ dill ];
+
+  # Python-version dependent tests
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Better multiprocessing and multithreading in python";
+    homepage = https://github.com/uqfoundation/multiprocess;
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/mypy-protobuf/default.nix b/pkgs/development/python-modules/mypy-protobuf/default.nix
new file mode 100644
index 000000000000..37e1b88a2481
--- /dev/null
+++ b/pkgs/development/python-modules/mypy-protobuf/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchPypi, buildPythonApplication, protobuf }:
+
+buildPythonApplication rec {
+  pname = "mypy-protobuf";
+  version = "1.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1bmpd82qm7rjnzc4i275lm18mmz8anhrjhwq2ci179l64hrfr0nb";
+  };
+
+  propagatedBuildInputs = [ protobuf ];
+
+  meta = with stdenv.lib; {
+    description = "Generate mypy stub files from protobuf specs";
+    homepage = "https://github.com/dropbox/mypy-protobuf";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ lnl7 ];
+  };
+}
diff --git a/pkgs/development/python-modules/netdisco/default.nix b/pkgs/development/python-modules/netdisco/default.nix
index e60233c3590e..1e404370284c 100644
--- a/pkgs/development/python-modules/netdisco/default.nix
+++ b/pkgs/development/python-modules/netdisco/default.nix
@@ -2,7 +2,7 @@
 
 buildPythonPackage rec {
   pname = "netdisco";
-  version = "1.5.0";
+  version = "2.0.0";
 
   disabled = !isPy3k;
 
@@ -11,7 +11,7 @@ buildPythonPackage rec {
     owner = "home-assistant";
     repo = pname;
     rev = version;
-    sha256 = "1lr0zpzdjkhcaihyxq8wv7c1wjm7xgx2sl8xmwp1kyivkgybk6n9";
+    sha256 = "08x5ab7v6a20753y9br7pvfm6a054ywn7y7gh6fydqski0gad6l7";
   };
 
   propagatedBuildInputs = [ requests zeroconf netifaces ];
diff --git a/pkgs/development/python-modules/orderedset/default.nix b/pkgs/development/python-modules/orderedset/default.nix
new file mode 100644
index 000000000000..f1e6f1bf918e
--- /dev/null
+++ b/pkgs/development/python-modules/orderedset/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "orderedset";
+  version = "2.0.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "11643qr12ypxfffcminlsgl9xz751b2d0pnjl6zn8vfhxddjr57f";
+  };
+
+  meta = with stdenv.lib; {
+    description = "An Ordered Set implementation in Cython";
+    homepage = https://pypi.python.org/pypi/orderedset;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jtojnar ];
+  };
+}
diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix
index 1a345b19ef94..9059080c9196 100644
--- a/pkgs/development/python-modules/protobuf/default.nix
+++ b/pkgs/development/python-modules/protobuf/default.nix
@@ -28,7 +28,10 @@ buildPythonPackage rec {
     export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
   '';
 
-  preBuild = optionalString (versionAtLeast protobuf.version "2.6.0") ''
+  preBuild = ''
+    # Workaround for https://github.com/google/protobuf/issues/2895
+    ${python}/bin/${python.executable} setup.py build
+  '' + optionalString (versionAtLeast protobuf.version "2.6.0") ''
     ${python}/bin/${python.executable} setup.py build_ext --cpp_implementation
   '';
 
diff --git a/pkgs/development/python-modules/pycrc/default.nix b/pkgs/development/python-modules/pycrc/default.nix
new file mode 100644
index 000000000000..e9ea8646b415
--- /dev/null
+++ b/pkgs/development/python-modules/pycrc/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "PyCRC";
+  version = "1.21";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "d3b0e788b501f48ae2ff6eeb34652343c9095e4356a65df217ed29b51e4045b6";
+  };
+
+  meta = with lib; {
+    homepage = https://github.com/cristianav/PyCRC;
+    description = "Python libraries for CRC calculations (it supports CRC-16, CRC-32, CRC-CCITT, etc)";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ guibou ];
+  };
+}
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/pygobject/default.nix b/pkgs/development/python-modules/pygobject/default.nix
index 796fc992a7dc..56e8f1fa5eb6 100644
--- a/pkgs/development/python-modules/pygobject/default.nix
+++ b/pkgs/development/python-modules/pygobject/default.nix
@@ -19,7 +19,7 @@ buildPythonPackage rec {
     ./pygobject-2.28.6-gio-types-2.32.patch
   ];
 
-  configureFlags = "--disable-introspection";
+  configureFlags = [ "--disable-introspection" ];
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ glib ];
diff --git a/pkgs/development/python-modules/pyjwt/default.nix b/pkgs/development/python-modules/pyjwt/default.nix
new file mode 100644
index 000000000000..f7d3e32f9922
--- /dev/null
+++ b/pkgs/development/python-modules/pyjwt/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildPythonPackage, fetchPypi
+, cryptography, ecdsa
+, pytestrunner, pytestcov, pytest }:
+
+buildPythonPackage rec {
+  pname = "PyJWT";
+  version = "1.6.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "4ee413b357d53fd3fb44704577afac88e72e878716116270d722723d65b42176";
+  };
+
+  propagatedBuildInputs = [ cryptography ecdsa ];
+
+  checkInputs = [ pytestrunner pytestcov pytest ];
+
+  meta = with lib; {
+    description = "JSON Web Token implementation in Python";
+    homepage = https://github.com/jpadilla/pyjwt;
+    license = licenses.mit;
+    maintainers = with maintainers; [ prikhi ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyls-black/default.nix b/pkgs/development/python-modules/pyls-black/default.nix
new file mode 100644
index 000000000000..b19fad1a1f19
--- /dev/null
+++ b/pkgs/development/python-modules/pyls-black/default.nix
@@ -0,0 +1,32 @@
+{ lib, buildPythonPackage, fetchFromGitHub
+, black, toml, pytest, python-language-server, isPy3k
+}:
+
+buildPythonPackage rec {
+  pname = "pyls-black";
+  version = "0.2.1";
+
+  src = fetchFromGitHub {
+    owner = "rupert";
+    repo = "pyls-black";
+    rev = "v${version}";
+    sha256 = "0xa3iv8nhnj0lw0dh41qb0dqp55sb6rdxalbk60v8jll6qyc0si8";
+  };
+
+  disabled = !isPy3k;
+
+  checkPhase = ''
+    pytest
+  '';
+
+  checkInputs = [ pytest ];
+
+  propagatedBuildInputs = [ black toml python-language-server ];
+
+  meta = with lib; {
+    homepage = https://github.com/rupert/pyls-black;
+    description = "Black plugin for the Python Language Server";
+    license = licenses.mit;
+    maintainers = [ maintainers.mic92 ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyls-isort/default.nix b/pkgs/development/python-modules/pyls-isort/default.nix
index fce7999a7569..fa94441e2003 100644
--- a/pkgs/development/python-modules/pyls-isort/default.nix
+++ b/pkgs/development/python-modules/pyls-isort/default.nix
@@ -21,8 +21,8 @@ buildPythonPackage rec {
   ];
 
   meta = with lib; {
-    homepage = https://github.com/palantir/python-language-server;
-    description = "An implementation of the Language Server Protocol for Python";
+    homepage = https://github.com/paradoxxxzero/pyls-isort;
+    description = "Isort plugin for python-language-server";
     license = licenses.mit;
     maintainers = [ maintainers.mic92 ];
   };
diff --git a/pkgs/development/python-modules/pyls-mypy/default.nix b/pkgs/development/python-modules/pyls-mypy/default.nix
index 985d1937d3fb..dfba421ae58d 100644
--- a/pkgs/development/python-modules/pyls-mypy/default.nix
+++ b/pkgs/development/python-modules/pyls-mypy/default.nix
@@ -1,29 +1,21 @@
-{ lib, buildPythonPackage, fetchFromGitHub, fetchpatch
+{ lib, buildPythonPackage, fetchFromGitHub
 , future, python-language-server, mypy, configparser
 , pytest, mock, isPy3k, pytestcov, coverage
 }:
 
 buildPythonPackage rec {
   pname = "pyls-mypy";
-  version = "0.1.2";
+  version = "0.1.3";
 
   src = fetchFromGitHub {
     owner = "tomv564";
     repo = "pyls-mypy";
     rev = version;
-    sha256 = "0wa038a8a8yj3wmrc7q909nj4b5d3lq70ysbw7rpsnyb0x06m826";
+    sha256 = "0v7ghcd1715lxlfq304b7xhchp31ahdd89lf6za4n0l59dz74swh";
   };
 
   disabled = !isPy3k;
 
-  patches = [
-    # also part of https://github.com/tomv564/pyls-mypy/pull/10
-    (fetchpatch {
-      url = "https://github.com/Mic92/pyls-mypy/commit/4c727120d2cbd8bf2825e1491cd55175f03266d2.patch";
-      sha256 = "1dgn5z742swpxwknmgvm65jpxq9zwzhggw4nl6ys7yw8r49kqgrl";
-    })
-  ];
-
   checkPhase = ''
     HOME=$TEMPDIR pytest
   '';
@@ -35,8 +27,8 @@ buildPythonPackage rec {
   ];
 
   meta = with lib; {
-    homepage = https://github.com/palantir/python-language-server;
-    description = "An implementation of the Language Server Protocol for Python";
+    homepage = https://github.com/tomv564/pyls-mypy;
+    description = "Mypy plugin for the Python Language Server";
     license = licenses.mit;
     maintainers = [ maintainers.mic92 ];
   };
diff --git a/pkgs/development/python-modules/pymysql/default.nix b/pkgs/development/python-modules/pymysql/default.nix
new file mode 100644
index 000000000000..b440df309977
--- /dev/null
+++ b/pkgs/development/python-modules/pymysql/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, cryptography
+}:
+
+buildPythonPackage rec {
+  pname = "PyMySQL";
+  version = "0.9.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0gvi63f1zq1bbd30x28kqyx351hal1yc323ckp0mihainb5n1iwy";
+  };
+
+  propagatedBuildInputs = [ cryptography ];
+
+  # Wants to connect to MySQL
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Pure Python MySQL Client";
+    homepage = https://github.com/PyMySQL/PyMySQL;
+    license = licenses.mit;
+    maintainers = [ maintainers.kalbasit ];
+  };
+}
diff --git a/pkgs/development/python-modules/pysrim/default.nix b/pkgs/development/python-modules/pysrim/default.nix
new file mode 100644
index 000000000000..90dfc1f56045
--- /dev/null
+++ b/pkgs/development/python-modules/pysrim/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, fetchPypi
+, buildPythonPackage
+, pytestrunner
+, numpy
+, pyyaml
+}:
+
+buildPythonPackage rec {
+  pname = "pysrim";
+  version = "0.5.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "6c297b4ea6f037946c72e94ddd9a7624cf2fd97c488acbee9409001c970754f1";
+  };
+
+  buildInputs = [ pytestrunner ];
+  propagatedBuildInputs = [ numpy pyyaml ];
+
+  # Tests require git lfs download of repository
+  doCheck = false;
+
+  meta = {
+    description = "Srim Automation of Tasks via Python";
+    homepage = https://gitlab.com/costrouc/pysrim;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ costrouc ];
+  };
+}
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index 5fda0994010e..0e3f89fa152f 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -27,10 +27,10 @@ buildPythonPackage rec {
     runHook postCheck
   '';
 
-  # Remove .pytest-cache when using py.test in a Nix build
+  # Remove .pytest_cache when using py.test in a Nix build
   setupHook = writeText "pytest-hook" ''
     postFixupHooks+=(
-        'find $out -name .pytest-cache -type d -exec rm -rf {} +'
+        'find $out -name .pytest_cache -type d -exec rm -rf {} +'
     )
   '';
 
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/pytidylib/default.nix b/pkgs/development/python-modules/pytidylib/default.nix
new file mode 100644
index 000000000000..4ece6fb41343
--- /dev/null
+++ b/pkgs/development/python-modules/pytidylib/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, buildPythonPackage, fetchPypi, python, html-tidy }:
+
+buildPythonPackage rec {
+  pname = "pytidylib";
+  version = "0.3.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "22b1c8d75970d8064ff999c2369e98af1d0685417eda4c829a5c9f56764b0af3";
+  };
+
+  postPatch = ''
+    # Patch path to library
+    substituteInPlace tidylib/tidy.py \
+      --replace "load_library(name)" \
+        "load_library('${html-tidy}/lib/libtidy${stdenv.hostPlatform.extensions.sharedLibrary}')"
+
+    # Test fails
+    substituteInPlace tests/test_docs.py \
+      --replace "    def test_large_document(self):" \
+        $'    @unittest.skip("")\n    def test_large_document(self):'
+  '';
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Python wrapper for HTML Tidy (tidylib) on Python 2 and 3";
+    homepage = https://countergram.github.io/pytidylib/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ layus ];
+  };
+}
diff --git a/pkgs/development/python-modules/robotframework/default.nix b/pkgs/development/python-modules/robotframework/default.nix
index f07d0208167c..6d19feed3fb7 100644
--- a/pkgs/development/python-modules/robotframework/default.nix
+++ b/pkgs/development/python-modules/robotframework/default.nix
@@ -1,13 +1,11 @@
-{ stdenv, fetchurl, buildPythonPackage, isPy3k }:
+{ stdenv, fetchPypi, buildPythonPackage }:
 
 buildPythonPackage rec {
-  version = "3.0.4";
   pname = "robotframework";
-  disabled = isPy3k;
-  name = pname + "-" + version;
+  version = "3.0.4";
 
-  src = fetchurl {
-    url = "mirror://pypi/r/robotframework/${name}.tar.gz";
+  src = fetchPypi {
+    inherit pname version;
     sha256 = "ab94257cbd848dfca7148e092d233a12853cc7e840ce8231af9cbb5e7f51aa47";
   };
 
diff --git a/pkgs/development/python-modules/robotsuite/default.nix b/pkgs/development/python-modules/robotsuite/default.nix
index 9fcced49b925..59ef766adf11 100644
--- a/pkgs/development/python-modules/robotsuite/default.nix
+++ b/pkgs/development/python-modules/robotsuite/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, buildPythonPackage, fetchPypi, unittest2, robotframework, lxml }:
+{ stdenv, buildPythonPackage, fetchPypi
+, unittest2, lxml, robotframework
+}:
 
 buildPythonPackage rec {
   pname = "robotsuite";
@@ -12,6 +14,11 @@ buildPythonPackage rec {
   buildInputs = [ unittest2 ];
   propagatedBuildInputs = [ robotframework lxml ];
 
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace robotframework-python3 robotframework
+  '';
+
   meta = with stdenv.lib; {
     description = "Python unittest test suite for Robot Framework";
     homepage = https://github.com/collective/robotsuite/;
diff --git a/pkgs/development/python-modules/scapy/default.nix b/pkgs/development/python-modules/scapy/default.nix
index c24592ef9650..393f8c2c1108 100644
--- a/pkgs/development/python-modules/scapy/default.nix
+++ b/pkgs/development/python-modules/scapy/default.nix
@@ -1,6 +1,14 @@
-{ stdenv, lib, buildPythonPackage, fetchFromGitHub, isPyPy, isPy3k, pythonOlder
-, matplotlib, pycrypto, ecdsa
+{ buildPythonPackage, fetchFromGitHub, lib, isPyPy, isPy3k, pythonOlder
+, pycrypto, ecdsa # TODO
 , enum34, mock
+, withOptionalDeps ? true, tcpdump, ipython
+, withCryptography ? true, cryptography
+, withVoipSupport ? true, sox
+, withPlottingSupport ? true, matplotlib
+, withGraphicsSupport ? false, pyx, texlive, graphviz, imagemagick
+, withManufDb ? false, wireshark
+# 2D/3D graphics and graphs TODO: VPython
+# TODO: nmap, numpy
 }:
 
 buildPythonPackage rec {
@@ -19,15 +27,23 @@ buildPythonPackage rec {
   # TODO: Temporary workaround
   patches = [ ./fix-version-1.patch ./fix-version-2.patch ];
 
-  propagatedBuildInputs =
-    [ matplotlib pycrypto ecdsa ]
+  postPatch = lib.optionalString withManufDb ''
+    substituteInPlace scapy/data.py --replace "/opt/wireshark" "${wireshark}"
+  '';
+
+  propagatedBuildInputs = [ pycrypto ecdsa ]
+    ++ lib.optional withOptionalDeps [ tcpdump ipython ]
+    ++ lib.optional withCryptography [ cryptography ]
+    ++ lib.optional withVoipSupport [ sox ]
+    ++ lib.optional withPlottingSupport [ matplotlib ]
+    ++ lib.optional withGraphicsSupport [ pyx texlive.combined.scheme-minimal graphviz imagemagick ]
     ++ lib.optional (isPy3k && pythonOlder "3.4") [ enum34 ]
     ++ lib.optional doCheck [ mock ];
 
   # Tests fail with Python 3.6 (seems to be an upstream bug, I'll investigate)
   doCheck = if isPy3k then false else true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Powerful interactive network packet manipulation program";
     homepage = https://scapy.net/;
     license = licenses.gpl2;
diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix
index 1661dd2cf3aa..cd4a6389a351 100644
--- a/pkgs/development/python-modules/selenium/default.nix
+++ b/pkgs/development/python-modules/selenium/default.nix
@@ -1,6 +1,6 @@
 { lib
 , stdenv
-, fetchurl
+, fetchPypi
 , fetchFromGitHub
 , buildPythonPackage
 , geckodriver
@@ -22,12 +22,11 @@ in
 
 buildPythonPackage rec {
   pname = "selenium";
-  version = "3.6.0";
-  name = pname + "-" + version;
+  version = "3.8.1";
 
-  src = fetchurl {
-    url = "mirror://pypi/s/selenium/${name}.tar.gz";
-    sha256 = "15qpvz0bdwjvpcj11fm0rw6r5inr66sqw89ww50l025sbhf04qwm";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1lqm2md84g11g7lqi94xqb5lydm93vgmlznfhf27g6sy9ayjvgcs";
   };
 
   buildInputs = [xorg.libX11];
diff --git a/pkgs/development/python-modules/shippai/default.nix b/pkgs/development/python-modules/shippai/default.nix
new file mode 100644
index 000000000000..ac035061692b
--- /dev/null
+++ b/pkgs/development/python-modules/shippai/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "shippai";
+  # Please make sure that vdirsyncer still builds if you update this package.
+  version = "0.2.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1ppwywzg4d12h658682ssmingm6ls6a96p4ak26i2w9d4lf8pfsc";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Use Rust failures as Python exceptions";
+    homepage = https://github.com/untitaker/shippai;
+    license = licenses.mit;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/pkgs/development/python-modules/singledispatch/default.nix b/pkgs/development/python-modules/singledispatch/default.nix
new file mode 100644
index 000000000000..e0b207735dfa
--- /dev/null
+++ b/pkgs/development/python-modules/singledispatch/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "singledispatch";
+  version = "3.4.0.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5b06af87df13818d14f08a028e42f566640aef80805c3b50c5056b086e3c2b9c";
+  };
+
+  propagatedBuildInputs = [ six ];
+
+  # pypi singledispatch tarbal does not contain tests
+  doCheck = false;
+
+  meta = {
+    description = "This library brings functools.singledispatch from Python 3.4 to Python 2.6-3.3.";
+    homepage = https://docs.python.org/3/library/functools.html;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ costrouc ];
+  };
+}
diff --git a/pkgs/development/python-modules/sortedcontainers/default.nix b/pkgs/development/python-modules/sortedcontainers/default.nix
new file mode 100644
index 000000000000..1252c676646d
--- /dev/null
+++ b/pkgs/development/python-modules/sortedcontainers/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "sortedcontainers";
+  version = "2.0.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "607294c6e291a270948420f7ffa1fb3ed47384a4c08db6d1e9c92d08a6981982";
+  };
+
+  # pypi tarball does not come with tests
+  doCheck = false;
+
+  meta = {
+    description = "Python Sorted Container Types: SortedList, SortedDict, and SortedSet";
+    homepage = http://www.grantjenks.com/docs/sortedcontainers/;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ costrouc ];
+  };
+}
diff --git a/pkgs/development/python-modules/tensorflow-tensorboard/default.nix b/pkgs/development/python-modules/tensorflow-tensorboard/default.nix
index 0d8085395736..5cd0e9266022 100644
--- a/pkgs/development/python-modules/tensorflow-tensorboard/default.nix
+++ b/pkgs/development/python-modules/tensorflow-tensorboard/default.nix
@@ -1,5 +1,4 @@
 { stdenv, lib, fetchPypi, buildPythonPackage, isPy3k
-, bleach_1_5_0
 , numpy
 , werkzeug
 , protobuf
@@ -14,7 +13,7 @@
 
 buildPythonPackage rec {
   pname = "tensorflow-tensorboard";
-  version = "1.7.0";
+  version = "1.9.0";
   format = "wheel";
 
   src = fetchPypi ({
@@ -23,13 +22,13 @@ buildPythonPackage rec {
     format = "wheel";
   } // (if isPy3k then {
     python = "py3";
-    sha256 = "1aa42rl3fkpllqch09d311gk1j281qry6nn07ywgbs6j0kwr6isc";
+    sha256 = "42a04637a636e16054b065907c81396b83a9702948ecd14218f19dc5cf85de98";
   } else {
     python = "py2";
-    sha256 = "1vcdkyvw22kpljmj4gxb8m1q54ry02iwvw54w8v8hmdigvc77a7k";
+    sha256 = "97661706fbe857c372405e0f5bd7c3db2197b5e70cec88f6924b726fde65c2c1";
   }));
 
-  propagatedBuildInputs = [ bleach_1_5_0 numpy werkzeug protobuf markdown grpcio ] ++ lib.optional (!isPy3k) futures;
+  propagatedBuildInputs = [ numpy werkzeug protobuf markdown grpcio ] ++ lib.optional (!isPy3k) futures;
 
   meta = with stdenv.lib; {
     description = "TensorFlow's Visualization Toolkit";
diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix
index 4e3621157f93..b09da2d4cecf 100644
--- a/pkgs/development/python-modules/tensorflow/bin.nix
+++ b/pkgs/development/python-modules/tensorflow/bin.nix
@@ -10,6 +10,7 @@
 , termcolor
 , protobuf
 , absl-py
+, grpcio
 , mock
 , backports_weakref
 , enum34
@@ -38,29 +39,31 @@ let
 
 in buildPythonPackage rec {
   pname = "tensorflow";
-  version = "1.7.1";
+  version = "1.9.0";
   format = "wheel";
 
   src = let
     pyVerNoDot = lib.strings.stringAsChars (x: if x == "." then "" else x) "${python.majorVersion}";
-    version = if stdenv.isDarwin then builtins.substring 0 1 pyVerNoDot else pyVerNoDot;
+    pyver = if stdenv.isDarwin then builtins.substring 0 1 pyVerNoDot else pyVerNoDot;
     platform = if stdenv.isDarwin then "mac" else "linux";
     unit = if cudaSupport then "gpu" else "cpu";
-    key = "${platform}_py_${version}_${unit}";
-    dls = import ./tf1.7.1-hashes.nix;
+    key = "${platform}_py_${pyver}_${unit}";
+    dls = import ./tf1.9.0-hashes.nix;
   in fetchurl dls.${key};
 
-  propagatedBuildInputs = [ numpy six protobuf absl-py astor gast termcolor ]
+  propagatedBuildInputs = [  protobuf numpy termcolor grpcio six astor absl-py gast tensorflow-tensorboard ]
                  ++ lib.optional (!isPy3k) mock
-                 ++ lib.optionals (pythonOlder "3.4") [ backports_weakref enum34 ]
-                 ++ lib.optional (pythonOlder "3.6") tensorflow-tensorboard;
+                 ++ lib.optionals (pythonOlder "3.4") [ backports_weakref enum34 ];
 
-  # tensorflow depends on tensorflow_tensorboard, which cannot be
-  # built at the moment (some of its dependencies do not build
-  # [htlm5lib9999999 (seven nines) -> tensorboard], and it depends on an old version of
-  # bleach) Hence we disable dependency checking for now.
-  installFlags = lib.optional isPy36 "--no-dependencies";
+  # Upstream has a pip hack that results in bin/tensorboard being in both tensorflow
+  # and the propageted input tensorflow-tensorboard which causes environment collisions.
+  # another possibility would be to have tensorboard only in the buildInputs
+  # https://github.com/tensorflow/tensorflow/blob/v1.7.1/tensorflow/tools/pip_package/setup.py#L79
+  postInstall = ''
+    rm $out/bin/tensorboard
+  '';
 
+  installFlags = "--no-dependencies"; # tensorflow wants setuptools 39, can't allow that.
   # Note that we need to run *after* the fixup phase because the
   # libraries are loaded at runtime. If we run in preFixup then
   # patchelf --shrink-rpath will remove the cuda libraries.
diff --git a/pkgs/development/python-modules/tensorflow/prefetcher.sh b/pkgs/development/python-modules/tensorflow/prefetcher.sh
index ba9aa0bdf356..6b98ece974eb 100644
--- a/pkgs/development/python-modules/tensorflow/prefetcher.sh
+++ b/pkgs/development/python-modules/tensorflow/prefetcher.sh
@@ -1,4 +1,4 @@
-version=1.7.1
+version=1.9.0
 hashfile=tf${version}-hashes.nix
 rm -f $hashfile
 echo "{" >> $hashfile
@@ -27,3 +27,4 @@ for sys in "linux" "mac"; do
         done
     done
 done
+echo "}" >> $hashfile
diff --git a/pkgs/development/python-modules/tensorflow/tf1.9.0-hashes.nix b/pkgs/development/python-modules/tensorflow/tf1.9.0-hashes.nix
new file mode 100644
index 000000000000..504ed7b5b957
--- /dev/null
+++ b/pkgs/development/python-modules/tensorflow/tf1.9.0-hashes.nix
@@ -0,0 +1,34 @@
+{
+linux_py_27_cpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp27-none-linux_x86_64.whl";
+  sha256 = "1dvmajv5ddgzrazdnxpfhk9dkj0lfiviw4jmvk00d4q5v68z6ihg";
+};
+linux_py_35_cpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp35-cp35m-linux_x86_64.whl";
+  sha256 = "07ilrxbhz9p3xwqhl2p8c40y1gsq68x10f34pzayrvcg2i52bvpv";
+};
+linux_py_36_cpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.9.0-cp36-cp36m-linux_x86_64.whl";
+  sha256 = "0x2l64ab7i8nr0dzvsryblhn869qyjb85xkhy69nwahqswb68hxl";
+};
+linux_py_27_gpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.9.0-cp27-none-linux_x86_64.whl";
+  sha256 = "0q7i82jgy0mzn2mw8i1z0pvv7ssi6m7zqkkjg2i4zxpk8djg8k6z";
+};
+linux_py_35_gpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.9.0-cp35-cp35m-linux_x86_64.whl";
+  sha256 = "0nhq2s8fanm095x1sc9h40dvqcv9bc2aj47crv3c2sajbj7dn43g";
+};
+linux_py_36_gpu = {
+  url = "https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.9.0-cp36-cp36m-linux_x86_64.whl";
+  sha256 = "1m4b9cd8ghghqxaqrlzq7j9499ddidgr78bx0c20pgyrzg38jiz1";
+};
+mac_py_2_cpu = {
+  url = "https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py2-none-any.whl";
+  sha256 = "1djj0xahzrmxhfc6kyjx1lkyfh7jhq3ix0gz9j3iq4smb3ca9z01";
+};
+mac_py_3_cpu = {
+  url = "https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl";
+  sha256 = "0igffy7r0d8mhkn4pybp19jmc25alfpfl4k4fxh2s3rvgii8gk22";
+};
+}
diff --git a/pkgs/development/python-modules/thespian/default.nix b/pkgs/development/python-modules/thespian/default.nix
index 0ced52c7ba10..c964a4ed2f10 100644
--- a/pkgs/development/python-modules/thespian/default.nix
+++ b/pkgs/development/python-modules/thespian/default.nix
@@ -1,13 +1,13 @@
 { fetchPypi, buildPythonPackage, lib }:
 
 buildPythonPackage rec {
-  version = "3.9.2";
+  version = "3.9.4";
   pname = "thespian";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "aec9793fecf45bb91fe919dc61b5c48a4aadfb9f94b06cd92883df7952eacf95";
+    sha256 = "98766eb304ef922133baca12a75eedd8d9b709c58bd9af50bfa5593dc3ffe0e1";
   };
 
   # Do not run the test suite: it takes a long time and uses
diff --git a/pkgs/development/python-modules/thumbor/default.nix b/pkgs/development/python-modules/thumbor/default.nix
index 37d8f3a51343..ec33a5020d47 100644
--- a/pkgs/development/python-modules/thumbor/default.nix
+++ b/pkgs/development/python-modules/thumbor/default.nix
@@ -1,17 +1,17 @@
-{ buildPythonPackage, stdenv, tornado, pycrypto, pycurl, pytz
+{ buildPythonPackage, tornado, pycrypto, pycurl, pytz
 , pillow, derpconf, python_magic, pexif, libthumbor, opencv, webcolors
 , piexif, futures, statsd, thumborPexif, fetchPypi, isPy3k, lib
 }:
 
 buildPythonPackage rec {
   pname = "thumbor";
-  version = "6.5.1";
+  version = "6.5.2";
 
   disabled = isPy3k; # see https://github.com/thumbor/thumbor/issues/1004
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0yalqwpxb6m0dz2qfnyv1pqqd5dd020wl7hc0n0bvsvxg1ib9if0";
+    sha256 = "1icfnzwzi5lvnh576n7v3r819jaw15ph9ja2w3fwg5z9qs40xvl8";
   };
 
   postPatch = ''
@@ -40,7 +40,7 @@ buildPythonPackage rec {
   # for further reference.
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A smart imaging service";
     homepage = https://github.com/thumbor/thumbor/wiki;
     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;
+  };
 }
diff --git a/pkgs/development/python-modules/tqdm/default.nix b/pkgs/development/python-modules/tqdm/default.nix
index 0b77f7068012..fd5cd47be383 100644
--- a/pkgs/development/python-modules/tqdm/default.nix
+++ b/pkgs/development/python-modules/tqdm/default.nix
@@ -5,6 +5,7 @@
 , coverage
 , glibcLocales
 , flake8
+, stdenv
 }:
 
 buildPythonPackage rec {
@@ -26,6 +27,8 @@ buildPythonPackage rec {
 
   LC_ALL="en_US.UTF-8";
 
+  doCheck = !stdenv.isDarwin;
+
   meta = {
     description = "A Fast, Extensible Progress Meter";
     homepage = https://github.com/tqdm/tqdm;
diff --git a/pkgs/development/python-modules/uuid/default.nix b/pkgs/development/python-modules/uuid/default.nix
new file mode 100644
index 000000000000..0481e5c24c0f
--- /dev/null
+++ b/pkgs/development/python-modules/uuid/default.nix
@@ -0,0 +1,16 @@
+{ lib, stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "uuid";
+  version = "1.30";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0gqrjsm85nnkxkmd1vk8350wqj2cigjflnvcydk084n5980cr1qz";
+  };
+
+  meta = with lib; {
+    description = "UUID object and generation functions (Python 2.3 or higher)";
+    homepage = http://zesty.ca/python/;
+  };
+}
diff --git a/pkgs/development/python-modules/visitor/default.nix b/pkgs/development/python-modules/visitor/default.nix
new file mode 100644
index 000000000000..78dc29bbeb0e
--- /dev/null
+++ b/pkgs/development/python-modules/visitor/default.nix
@@ -0,0 +1,18 @@
+{ lib, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "visitor";
+  version = "0.1.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "02j87v93c50gz68gbgclmbqjcwcr7g7zgvk7c6y4x1mnn81pjwrc";
+  };
+
+  meta = with lib; {
+    homepage = https://github.com/mbr/visitor;
+    description = "A tiny pythonic visitor implementation";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/pkgs/development/python-modules/zeep/default.nix b/pkgs/development/python-modules/zeep/default.nix
index f283479c8de8..b14e0226d732 100644
--- a/pkgs/development/python-modules/zeep/default.nix
+++ b/pkgs/development/python-modules/zeep/default.nix
@@ -20,6 +20,7 @@
 , pytestcov
 , requests-mock
 , tornado
+, attrs
 }:
 
 buildPythonPackage rec {
@@ -32,6 +33,7 @@ buildPythonPackage rec {
   };
 
   propagatedBuildInputs = [
+    attrs
     appdirs
     cached-property
     defusedxml