about 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/GitPython/default.nix24
-rw-r--r--pkgs/development/python-modules/Theano/default.nix9
-rw-r--r--pkgs/development/python-modules/asyncssh/default.nix36
-rw-r--r--pkgs/development/python-modules/cdecimal/default.nix25
-rw-r--r--pkgs/development/python-modules/configobj/default.nix23
-rw-r--r--pkgs/development/python-modules/contextvars/default.nix21
-rw-r--r--pkgs/development/python-modules/cx_oracle/0001-odpi-src-dpiOci.c-nixify-libclntsh.so-dlopen.patch27
-rw-r--r--pkgs/development/python-modules/cx_oracle/default.nix12
-rw-r--r--pkgs/development/python-modules/deluge-client/default.nix4
-rw-r--r--pkgs/development/python-modules/docker-pycreds/default.nix4
-rw-r--r--pkgs/development/python-modules/docker/default.nix4
-rw-r--r--pkgs/development/python-modules/geojson/default.nix21
-rw-r--r--pkgs/development/python-modules/gitdb/default.nix23
-rw-r--r--pkgs/development/python-modules/gitdb2/default.nix23
-rw-r--r--pkgs/development/python-modules/goocalendar/default.nix44
-rw-r--r--pkgs/development/python-modules/hiro/default.nix19
-rw-r--r--pkgs/development/python-modules/immutables/default.nix19
-rw-r--r--pkgs/development/python-modules/ipython/5.nix4
-rw-r--r--pkgs/development/python-modules/isort/default.nix28
-rw-r--r--pkgs/development/python-modules/keyrings-alt/default.nix25
-rw-r--r--pkgs/development/python-modules/libgpuarray/default.nix7
-rw-r--r--pkgs/development/python-modules/mail-parser/default.nix41
-rw-r--r--pkgs/development/python-modules/outcome/default.nix27
-rw-r--r--pkgs/development/python-modules/ply/default.nix42
-rw-r--r--pkgs/development/python-modules/podcats/default.nix28
-rw-r--r--pkgs/development/python-modules/prometheus_client/default.nix19
-rw-r--r--pkgs/development/python-modules/pyairvisual/default.nix30
-rw-r--r--pkgs/development/python-modules/pyhomematic/default.nix14
-rw-r--r--pkgs/development/python-modules/pylibconfig2/default.nix21
-rw-r--r--pkgs/development/python-modules/pyogg/default.nix39
-rw-r--r--pkgs/development/python-modules/pypcap/default.nix31
-rw-r--r--pkgs/development/python-modules/pysdl2/PySDL2-dll.patch119
-rw-r--r--pkgs/development/python-modules/pysdl2/default.nix41
-rw-r--r--pkgs/development/python-modules/pysensors/default.nix32
-rw-r--r--pkgs/development/python-modules/pytorch/default.nix35
-rw-r--r--pkgs/development/python-modules/sasmodels/default.nix28
-rw-r--r--pkgs/development/python-modules/smmap/default.nix19
-rw-r--r--pkgs/development/python-modules/smmap2/default.nix20
-rw-r--r--pkgs/development/python-modules/timeout-decorator/default.nix16
-rw-r--r--pkgs/development/python-modules/traitlets/default.nix8
-rw-r--r--pkgs/development/python-modules/trio/default.nix42
-rw-r--r--pkgs/development/python-modules/trustme/default.nix26
-rw-r--r--pkgs/development/python-modules/twine/default.nix4
-rw-r--r--pkgs/development/python-modules/uproot/default.nix22
-rw-r--r--pkgs/development/python-modules/uranium/default.nix4
45 files changed, 1021 insertions, 89 deletions
diff --git a/pkgs/development/python-modules/GitPython/default.nix b/pkgs/development/python-modules/GitPython/default.nix
new file mode 100644
index 000000000000..c2f3706923a3
--- /dev/null
+++ b/pkgs/development/python-modules/GitPython/default.nix
@@ -0,0 +1,24 @@
+{ lib, buildPythonPackage, fetchPypi, gitdb2, mock, nose, ddt }:
+
+buildPythonPackage rec {
+  version = "2.1.9";
+  pname = "GitPython";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0a9in1jfv9ssxhckl6sasw45bhm762y2r5ikgb2pk2g8yqdc6z64";
+  };
+
+  checkInputs = [ mock nose ddt ];
+  propagatedBuildInputs = [ gitdb2 ];
+
+  # Tests require a git repo
+  doCheck = false;
+
+  meta = {
+    description = "Python Git Library";
+    maintainers = [ ];
+    homepage = https://github.com/gitpython-developers/GitPython;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix
index 03dc825218e2..9eb04782d6f8 100644
--- a/pkgs/development/python-modules/Theano/default.nix
+++ b/pkgs/development/python-modules/Theano/default.nix
@@ -15,17 +15,24 @@
 , libgpuarray
 , cudaSupport ? false, cudatoolkit
 , cudnnSupport ? false, cudnn
+, nvidia_x11
 }:
 
 assert cudnnSupport -> cudaSupport;
 
+assert cudaSupport -> nvidia_x11 != null
+                   && cudatoolkit != 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 cudnnSupport [ "-I ${cudnn}/include" "-L ${cudnn}/lib" ]
+    ++ lib.optionals cudaSupport [ "-I ${libgpuarray}/include" "-L ${libgpuarray}/lib" ];
 
   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++ "$@"
   '';
diff --git a/pkgs/development/python-modules/asyncssh/default.nix b/pkgs/development/python-modules/asyncssh/default.nix
new file mode 100644
index 000000000000..d5ab50dc9046
--- /dev/null
+++ b/pkgs/development/python-modules/asyncssh/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, buildPythonPackage, fetchPypi, pythonOlder
+, cryptography
+, bcrypt, gssapi, libnacl, libsodium, nettle, pyopenssl }:
+
+buildPythonPackage rec {
+  pname = "asyncssh";
+  version = "1.13.0";
+  disabled = pythonOlder "3.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1n75z4dvhzymd4n610dpwlq7wl8cyz1gxx9m7iq92pzhss5vgpfd";
+  };
+
+  propagatedBuildInputs = [ 
+    bcrypt
+    cryptography
+    gssapi
+    libnacl
+    libsodium
+    nettle
+    pyopenssl
+  ];
+
+  # Disables windows specific test (specifically the GSSAPI wrapper for Windows)
+  postPatch = ''
+    rm ./tests/sspi_stub.py
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Provides an asynchronous client and server implementation of the SSHv2 protocol on top of the Python asyncio framework";
+    homepage = https://pypi.python.org/pypi/asyncssh;
+    license = licenses.epl10;
+    maintainers = with maintainers; [ worldofpeace ];
+  };
+}
diff --git a/pkgs/development/python-modules/cdecimal/default.nix b/pkgs/development/python-modules/cdecimal/default.nix
new file mode 100644
index 000000000000..2c0b0e623ca9
--- /dev/null
+++ b/pkgs/development/python-modules/cdecimal/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, wget, buildPythonPackage, isPy3k }:
+
+with stdenv.lib;
+
+buildPythonPackage rec {
+  pname = "cdecimal";
+  version = "2.3";
+
+  disabled = isPy3k;
+
+  src = fetchurl {
+    url="http://www.bytereef.org/software/mpdecimal/releases/${pname}-${version}.tar.gz";
+    sha256 = "d737cbe43ed1f6ad9874fb86c3db1e9bbe20c0c750868fde5be3f379ade83d8b";
+  };
+
+  # Upstream tests are not included s. a. http://www.bytereef.org/mpdecimal/testing.html
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Fast drop-in replacement for decimal.py";
+    homepage    = http://www.bytereef.org/mpdecimal/;
+    license     = licenses.bsd2;
+    maintainers = [ maintainers.udono ];
+  };
+}
diff --git a/pkgs/development/python-modules/configobj/default.nix b/pkgs/development/python-modules/configobj/default.nix
index 98631b6920b3..dd2b26e0f591 100644
--- a/pkgs/development/python-modules/configobj/default.nix
+++ b/pkgs/development/python-modules/configobj/default.nix
@@ -1,19 +1,30 @@
-{ stdenv, buildPythonPackage, fetchPypi, six }:
+{ stdenv, buildPythonPackage
+, fetchFromGitHub
+, six
+, mock, pytest
+}:
 
 buildPythonPackage rec {
   pname = "configobj";
   version = "5.0.6";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "00h9rcmws03xvdlfni11yb60bz3kxfvsj6dg6nrpzj71f03nbxd2";
+  # Pypi archives don't contain the tests
+  src = fetchFromGitHub {
+    owner = "DiffSK";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0x97794nk3dfn0i3si9fv7y19jnpnarb34bkdwlz7ii7ag6xihhw";
   };
 
-  # error: invalid command 'test'
-  doCheck = false;
 
   propagatedBuildInputs = [ six ];
 
+  checkPhase = ''
+    pytest --deselect=tests/test_configobj.py::test_options_deprecation
+  '';
+
+  checkInputs = [ mock pytest ];
+
   meta = with stdenv.lib; {
     description = "Config file reading, writing and validation";
     homepage = https://pypi.python.org/pypi/configobj;
diff --git a/pkgs/development/python-modules/contextvars/default.nix b/pkgs/development/python-modules/contextvars/default.nix
new file mode 100644
index 000000000000..d8ee3b1ca9ef
--- /dev/null
+++ b/pkgs/development/python-modules/contextvars/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildPythonPackage, fetchPypi, isPy36, immutables }:
+
+buildPythonPackage rec {
+  pname = "contextvars";
+  version = "2.2";
+  disabled = !isPy36;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "046b385nfzkjh0wqmd268p2jkgn9fg6hz40npq7j1w3c8aqzhwvx";
+  };
+
+  propagatedBuildInputs = [ immutables ];
+
+  meta = {
+    description = "A backport of the Python 3.7 contextvars module for Python 3.6";
+    homepage = https://github.com/MagicStack/contextvars;
+    license = with lib.licenses; [ asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/cx_oracle/0001-odpi-src-dpiOci.c-nixify-libclntsh.so-dlopen.patch b/pkgs/development/python-modules/cx_oracle/0001-odpi-src-dpiOci.c-nixify-libclntsh.so-dlopen.patch
new file mode 100644
index 000000000000..a2de7b248531
--- /dev/null
+++ b/pkgs/development/python-modules/cx_oracle/0001-odpi-src-dpiOci.c-nixify-libclntsh.so-dlopen.patch
@@ -0,0 +1,27 @@
+From 355b9d812efdfbd041e14b365258b69c81689981 Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Thu, 17 May 2018 18:37:40 +0200
+Subject: [PATCH] odpi/src/dpiOci.c: nixify libclntsh.so dlopen
+
+---
+ odpi/src/dpiOci.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/odpi/src/dpiOci.c b/odpi/src/dpiOci.c
+index 76b9867..22c2987 100644
+--- a/odpi/src/dpiOci.c
++++ b/odpi/src/dpiOci.c
+@@ -1575,6 +1575,10 @@ static int dpiOci__loadLib(dpiError *error)
+             }
+         }
+     }
++    if(!dpiOciLibHandle) {
++        dpiOciLibHandle = dlopen("@libclntsh@", RTLD_LAZY);
++    }
++
+ #endif
+ 
+     if (!dpiOciLibHandle) {
+-- 
+2.16.3
+
diff --git a/pkgs/development/python-modules/cx_oracle/default.nix b/pkgs/development/python-modules/cx_oracle/default.nix
index f2e10caad726..717faf1128f0 100644
--- a/pkgs/development/python-modules/cx_oracle/default.nix
+++ b/pkgs/development/python-modules/cx_oracle/default.nix
@@ -2,7 +2,7 @@
 
 buildPythonPackage rec {
   pname = "cx_Oracle";
-  version = "6.2.1";
+  version = "6.3.1";
 
   buildInputs = [
     oracle-instantclient
@@ -10,10 +10,16 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "01970bc843b3c699a7fd98af19e0401fe69abfbd2acdf464e0bf2ae06ea372b9";
+    sha256 = "0200j6jh80rpgzxmvgcxmkshaj4zadq32g2i97nlwiq3f7q374l7";
   };
 
-  # Check need an Oracle database to run  
+  patches = [ ./0001-odpi-src-dpiOci.c-nixify-libclntsh.so-dlopen.patch ];
+
+  postPatch = ''
+    substituteInPlace odpi/src/dpiOci.c --replace @libclntsh@ "${oracle-instantclient}/lib/libclntsh.so";
+  '';
+
+  # Check need an Oracle database to run
   doCheck = false;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/deluge-client/default.nix b/pkgs/development/python-modules/deluge-client/default.nix
index 0c06bc55c7a9..cc991c7aeb4d 100644
--- a/pkgs/development/python-modules/deluge-client/default.nix
+++ b/pkgs/development/python-modules/deluge-client/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "deluge-client";
-  version = "1.3.0";
+  version = "1.4.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "27a7f4c6da8f057e03171a493f17340f39f288199a21beb3226a188ab3c02cea";
+    sha256 = "86979ebcb9f1f991554308e88c7a57469cbf339958b44c71cbdcba128291b043";
   };
 
   # it will try to connect to a running instance
diff --git a/pkgs/development/python-modules/docker-pycreds/default.nix b/pkgs/development/python-modules/docker-pycreds/default.nix
index 9cc510bf9af3..dd20400ea4f4 100644
--- a/pkgs/development/python-modules/docker-pycreds/default.nix
+++ b/pkgs/development/python-modules/docker-pycreds/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "docker-pycreds";
-  version = "0.2.2";
+  version = "0.2.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "c7ab85de2894baff6ee8f15160cbbfa2fd3a04e56f0372c5793d24060687b299";
+    sha256 = "e3732a03610a00461a716997670c7010bf1c214a3edc440f7d6a2a3a830ecd9d";
   };
 
   # require docker-credential-helpers binaries
diff --git a/pkgs/development/python-modules/docker/default.nix b/pkgs/development/python-modules/docker/default.nix
index c290c6bd177b..2ae56b7dc5a7 100644
--- a/pkgs/development/python-modules/docker/default.nix
+++ b/pkgs/development/python-modules/docker/default.nix
@@ -3,12 +3,12 @@
 , ipaddress, backports_ssl_match_hostname, docker_pycreds
 }:
 buildPythonPackage rec {
-  version = "3.2.1";
+  version = "3.3.0";
   pname = "docker";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0d698c3dc4df66c988de5df21a62cdc3450de2fa8523772779e5e23799c41f43";
+    sha256 = "dc5cc0971a0d36fe94c5ce89bd4adb6c892713500af7b0818708229c3199911a";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/geojson/default.nix b/pkgs/development/python-modules/geojson/default.nix
new file mode 100644
index 000000000000..902d1b266534
--- /dev/null
+++ b/pkgs/development/python-modules/geojson/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildPythonPackage, fetchPypi, glibcLocales }:
+
+buildPythonPackage rec {
+  pname = "geojson";
+  version = "2.3.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "06ihcb8839zzgk5jcv18kc6nqld4hhj3nk4f3drzcr8n8893v1y8";
+  };
+
+  LC_ALL = "en_US.UTF-8";
+  checkInputs = [ glibcLocales ];
+
+  meta = {
+    homepage = https://github.com/frewsxcv/python-geojson;
+    description = "Python bindings and utilities for GeoJSON";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ geistesk ];
+  };
+}
diff --git a/pkgs/development/python-modules/gitdb/default.nix b/pkgs/development/python-modules/gitdb/default.nix
new file mode 100644
index 000000000000..ceca6e3719b4
--- /dev/null
+++ b/pkgs/development/python-modules/gitdb/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildPythonPackage, fetchPypi, smmap }:
+
+buildPythonPackage rec {
+  pname = "gitdb";
+  version = "0.6.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0n4n2c7rxph9vs2l6xlafyda5x1mdr8xy16r9s3jwnh3pqkvrsx3";
+  };
+
+  propagatedBuildInputs = [ smmap ];
+
+  # Bunch of tests fail because they need an actual git repo
+  doCheck = false;
+
+  meta = {
+    description = "Git Object Database";
+    maintainers = [ ];
+    homepage = https://github.com/gitpython-developers/gitdb;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/gitdb2/default.nix b/pkgs/development/python-modules/gitdb2/default.nix
new file mode 100644
index 000000000000..1ebbd3de7850
--- /dev/null
+++ b/pkgs/development/python-modules/gitdb2/default.nix
@@ -0,0 +1,23 @@
+{ lib, buildPythonPackage, fetchPypi, smmap2 }:
+
+buildPythonPackage rec {
+  pname = "gitdb2";
+  version = "2.0.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "02azg62mr99b7cllyjrly77np3vw32y8nrxpa2xjapiyaga2j3mn";
+  };
+
+  propagatedBuildInputs = [ smmap2 ];
+
+  # Bunch of tests fail because they need an actual git repo
+  doCheck = false;
+
+  meta = {
+    description = "Git Object Database";
+    maintainers = [ ];
+    homepage = https://github.com/gitpython-developers/gitdb;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/goocalendar/default.nix b/pkgs/development/python-modules/goocalendar/default.nix
new file mode 100644
index 000000000000..f6e67ad43923
--- /dev/null
+++ b/pkgs/development/python-modules/goocalendar/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, fetchPypi
+, buildPythonPackage
+, pkgconfig
+, gtk3
+, gobjectIntrospection
+, pygtk
+, pygobject3
+, goocanvas2
+, isPy3k
+ }:
+
+with stdenv.lib;
+
+buildPythonPackage rec {
+  pname = "GooCalendar";
+  version = "0.3";
+
+  disabled = isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1p7qbcv06xipg48sgpdlqf72ajl3n1qlypcc0giyi1a72zpyf823";
+  };
+  nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
+  propagatedBuildInputs = [
+    pygtk
+    pygobject3
+  ];
+  buildInputs = [
+    gtk3
+    goocanvas2
+  ];
+
+  # No upstream tests available
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "A calendar widget for GTK using PyGoocanvas.";
+    homepage    = https://goocalendar.tryton.org/;
+    license     = licenses.gpl2;
+    maintainers = [ maintainers.udono ];
+  };
+}
diff --git a/pkgs/development/python-modules/hiro/default.nix b/pkgs/development/python-modules/hiro/default.nix
new file mode 100644
index 000000000000..0289c008e7e8
--- /dev/null
+++ b/pkgs/development/python-modules/hiro/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, buildPythonPackage, fetchPypi, six, mock }:
+buildPythonPackage rec {
+  pname = "hiro";
+  version = "0.1.4";
+  src = fetchPypi {
+    inherit pname version;
+
+    sha256 = "1340lhg7k522bqpz5iakl51qb47mjw804mfwwzm77i7qcm5cwiz8";
+  };
+
+  propagatedBuildInputs = [ six mock ];
+
+  meta = with stdenv.lib; {
+    description = "Time manipulation utilities for Python";
+    homepage = http://hiro.readthedocs.io/en/latest/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ nyarly ];
+  };
+}
diff --git a/pkgs/development/python-modules/immutables/default.nix b/pkgs/development/python-modules/immutables/default.nix
new file mode 100644
index 000000000000..975353406ca9
--- /dev/null
+++ b/pkgs/development/python-modules/immutables/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildPythonPackage, fetchPypi, pythonOlder }:
+
+buildPythonPackage rec {
+  pname = "immutables";
+  version = "0.5";
+  disabled = pythonOlder "3.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1hba0vkqanwfnb5b3rs14bs7schsmczhan5nd93c1i6fzi17glap";
+  };
+
+  meta = {
+    description = "An immutable mapping type for Python";
+    homepage = https://github.com/MagicStack/immutables;
+    license = with lib.licenses; [ asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/ipython/5.nix b/pkgs/development/python-modules/ipython/5.nix
index 083c1f3b08dd..a91988bd97d0 100644
--- a/pkgs/development/python-modules/ipython/5.nix
+++ b/pkgs/development/python-modules/ipython/5.nix
@@ -27,11 +27,11 @@
 
 buildPythonPackage rec {
   pname = "ipython";
-  version = "5.6.0";
+  version = "5.7.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "00g696r9rk1c4p3sycnv7by55cp9mm7r6zkkdqbiw9l0mk8k58wb";
+    sha256 = "0g1jm06qriq48m58311cs7askp83ipq3yq96hv4kg431nxzkmd4d";
   };
 
   prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
diff --git a/pkgs/development/python-modules/isort/default.nix b/pkgs/development/python-modules/isort/default.nix
new file mode 100644
index 000000000000..5a7e50d43322
--- /dev/null
+++ b/pkgs/development/python-modules/isort/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildPythonPackage, fetchPypi, isPy27, futures, mock, pytest }:
+
+buildPythonPackage rec {
+  pname = "isort";
+  version = "4.3.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1y0yfv56cqyh9wyg7kxxv9y5wmfgcq18n7a49mp7xmzka2bhxi5r";
+  };
+
+  propagatedBuildInputs = lib.optional isPy27 futures;
+
+  checkInputs = [ mock pytest ];
+
+  checkPhase = ''
+    py.test test_isort.py -k "not test_long_line_comments \
+                          and not test_import_case_produces_inconsistent_results_issue_472 \
+                          and not test_no_extra_lines_issue_557"
+  '';
+
+  meta = with lib; {
+    description = "A Python utility / library to sort Python imports";
+    homepage = https://github.com/timothycrosley/isort;
+    license = licenses.mit;
+    maintainers = with maintainers; [ couchemar nand0p ];
+  };
+}
diff --git a/pkgs/development/python-modules/keyrings-alt/default.nix b/pkgs/development/python-modules/keyrings-alt/default.nix
new file mode 100644
index 000000000000..140d4297cda5
--- /dev/null
+++ b/pkgs/development/python-modules/keyrings-alt/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, buildPythonPackage, fetchPypi, six
+, pytest, unittest2, mock, keyring
+}:
+
+buildPythonPackage rec {
+  pname = "keyrings.alt";
+  version = "2.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5cb9b6cdb5ce5e8216533e342d3e1b418ddd210466834061966d7dc1a4736f2d";
+  };
+  propagatedBuildInputs = [ six ];
+
+  # Fails with "ImportError: cannot import name mock"
+  doCheck = false;
+  checkInputs = [ pytest unittest2 mock keyring ];
+
+  meta = with stdenv.lib; {
+    license = licenses.mit;
+    description = "Alternate keyring implementations";
+    homepage = https://github.com/jaraco/keyrings.alt;
+    maintainers = with maintainers; [ nyarly ];
+  };
+}
diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix
index 26fe33995ed8..14e83584678c 100644
--- a/pkgs/development/python-modules/libgpuarray/default.nix
+++ b/pkgs/development/python-modules/libgpuarray/default.nix
@@ -9,10 +9,13 @@
 , nose
 , Mako
 , python
-, cudaSupport ? false, cudatoolkit
+, cudaSupport ? false, cudatoolkit , nvidia_x11
 , openclSupport ? true, ocl-icd, clblas
 }:
 
+assert cudaSupport -> nvidia_x11 != null
+                   && cudatoolkit != null;
+
 buildPythonPackage rec {
   pname = "libgpuarray";
   version = "0.7.5";
@@ -32,7 +35,7 @@ buildPythonPackage rec {
 
   libraryPath = lib.makeLibraryPath (
     []
-    ++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out ]
+    ++ lib.optionals cudaSupport [ cudatoolkit.lib cudatoolkit.out nvidia_x11 ]
     ++ lib.optionals openclSupport ([ clblas ] ++ lib.optional (!stdenv.isDarwin) ocl-icd)
   );
 
diff --git a/pkgs/development/python-modules/mail-parser/default.nix b/pkgs/development/python-modules/mail-parser/default.nix
new file mode 100644
index 000000000000..e05dc3f2861f
--- /dev/null
+++ b/pkgs/development/python-modules/mail-parser/default.nix
@@ -0,0 +1,41 @@
+{ lib, buildPythonPackage, python, pythonOlder, glibcLocales, fetchFromGitHub, ipaddress, six, simplejson }:
+
+buildPythonPackage rec {
+  pname = "mail-parser";
+  version = "3.3.1";
+
+  # no tests in PyPI tarball
+  src = fetchFromGitHub {
+    owner = "SpamScope";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1b1v61zwgdx2xjzds3hp6bv53yq424hhlrhf445n4faj1l0c4lkg";
+  };
+
+  LC_ALL = "en_US.utf-8";
+
+  # ipaddress is part of the standard library of Python 3.3+
+  prePatch = lib.optionalString (!pythonOlder "3.3") ''
+    substituteInPlace requirements.txt \
+      --replace "ipaddress" ""
+  '';
+
+  nativeBuildInputs = [ glibcLocales ];
+  propagatedBuildInputs = [ simplejson six ] ++ lib.optional (pythonOlder "3.3") ipaddress;
+
+  # Taken from .travis.yml
+  checkPhase = ''
+    ${python.interpreter} tests/test_main.py
+    ${python.interpreter} -m mailparser -v
+    ${python.interpreter} -m mailparser -h
+    ${python.interpreter} -m mailparser -f tests/mails/mail_malformed_3 -j
+    cat tests/mails/mail_malformed_3 | ${python.interpreter} -m mailparser -k -j
+  '';
+
+  meta = with lib; {
+    description = "A mail parser for python 2 and 3";
+    homepage = https://github.com/SpamScope/mail-parser;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ psyanticy ];
+  };
+}
diff --git a/pkgs/development/python-modules/outcome/default.nix b/pkgs/development/python-modules/outcome/default.nix
new file mode 100644
index 000000000000..e91925c75d50
--- /dev/null
+++ b/pkgs/development/python-modules/outcome/default.nix
@@ -0,0 +1,27 @@
+{ lib, buildPythonPackage, fetchPypi, pythonOlder
+, attrs
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "outcome";
+  version = "0.1.0a0";
+  disabled = pythonOlder "3.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0cqwakzigw0602dxlb7c1882jwr8hn5nrxk1l8iwlmzc9whh48wn";
+  };
+
+  checkInputs = [ pytest ];
+  propagatedBuildInputs = [ attrs ];
+  # Has a test dependency on trio, which depends on outcome.
+  doCheck = false;
+
+  meta = {
+    description = "Capture the outcome of Python function calls.";
+    homepage = https://github.com/python-trio/outcome;
+    license = with lib.licenses; [ mit asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/ply/default.nix b/pkgs/development/python-modules/ply/default.nix
new file mode 100644
index 000000000000..ae55cac642f5
--- /dev/null
+++ b/pkgs/development/python-modules/ply/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "ply";
+  version = "3.11";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3";
+  };
+
+  checkPhase = ''
+    ${python.interpreter} test/testlex.py
+    ${python.interpreter} test/testyacc.py
+  '';
+
+  # Test suite appears broken
+  doCheck = false;
+
+  meta = {
+    homepage = http://www.dabeaz.com/ply/;
+    description = "PLY (Python Lex-Yacc), an implementation of the lex and yacc parsing tools for Python";
+    longDescription = ''
+      PLY is an implementation of lex and yacc parsing tools for Python.
+      In a nutshell, PLY is nothing more than a straightforward lex/yacc
+      implementation.  Here is a list of its essential features: It's
+      implemented entirely in Python; It uses LR-parsing which is
+      reasonably efficient and well suited for larger grammars; PLY
+      provides most of the standard lex/yacc features including support for
+      empty productions, precedence rules, error recovery, and support for
+      ambiguous grammars; PLY is straightforward to use and provides very
+      extensive error checking; PLY doesn't try to do anything more or less
+      than provide the basic lex/yacc functionality.  In other words, it's
+      not a large parsing framework or a component of some larger system.
+    '';
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/podcats/default.nix b/pkgs/development/python-modules/podcats/default.nix
new file mode 100644
index 000000000000..a1b8312b134f
--- /dev/null
+++ b/pkgs/development/python-modules/podcats/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildPythonPackage, fetchFromGitHub, flask, mutagen }:
+
+buildPythonPackage rec {
+  pname = "podcats";
+  version = "v0.5.0";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "jakubroztocil";
+    repo = "podcats";
+    rev = version;
+    sha256 = "0zjdgry5n209rv19kj9yaxy7c7zq5gxr488izrgs4sc75vdzz8xc";
+  };
+
+  patchPhase = ''
+    substituteInPlace podcats.py \
+      --replace 'debug=True' 'debug=True, use_reloader=False'
+  '';
+
+  propagatedBuildInputs = [ flask mutagen ];
+
+  meta = {
+    description = "Application that generates RSS feeds for podcast episodes from local audio files";
+    homepage = https://github.com/jakubroztocil/podcats;
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ the-kenny ];
+  };
+}
diff --git a/pkgs/development/python-modules/prometheus_client/default.nix b/pkgs/development/python-modules/prometheus_client/default.nix
new file mode 100644
index 000000000000..eaf353af0823
--- /dev/null
+++ b/pkgs/development/python-modules/prometheus_client/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, buildPythonPackage, fetchPypi, pytest }:
+
+buildPythonPackage rec {
+  pname = "prometheus_client";
+  version = "0.2.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1r3510jq6iryd2a8jln2qpvqy112y5502ncbfkn116xl7gj74r6r";
+  };
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Prometheus instrumentation library for Python applications";
+    homepage = https://github.com/prometheus/client_python;
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/python-modules/pyairvisual/default.nix b/pkgs/development/python-modules/pyairvisual/default.nix
new file mode 100644
index 000000000000..010c2805d2b6
--- /dev/null
+++ b/pkgs/development/python-modules/pyairvisual/default.nix
@@ -0,0 +1,30 @@
+{ lib, buildPythonPackage, isPy3k, fetchFromGitHub, requests
+, requests-mock, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "pyairvisual";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "bachya";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0ng6k07n91k5l68zk3hl4fywb33admp84wqdm20qmmw9yc9c64fd";
+  };
+
+  checkInputs = [ pytest requests-mock ];
+  propagatedBuildInputs = [ requests ];
+
+  checkPhase = ''
+    py.test tests
+  '';
+
+  disabled = !isPy3k;
+
+  meta = with lib; {
+    description = "A thin Python wrapper for the AirVisual API";
+    license = licenses.mit;
+    homepage = https://github.com/bachya/pyairvisual;
+  };
+}
diff --git a/pkgs/development/python-modules/pyhomematic/default.nix b/pkgs/development/python-modules/pyhomematic/default.nix
index 0967659a641f..ea364c09b807 100644
--- a/pkgs/development/python-modules/pyhomematic/default.nix
+++ b/pkgs/development/python-modules/pyhomematic/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, buildPythonPackage, isPy3k, fetchFromGitHub }:
+{ stdenv, buildPythonPackage, isPy3k, fetchPypi }:
 
 buildPythonPackage rec {
   pname = "pyhomematic";
-  version = "0.1.42";
+  version = "0.1.43";
 
   disabled = !isPy3k;
 
-  # PyPI tarball does not include tests/ directory
-  src = fetchFromGitHub {
-    owner = "danielperna84";
-    repo = pname;
-    rev = version;
-    sha256 = "0h7bq66q22kzj1xwhxmr7knibsmb4csjwq3jr19fyl9sxxmgqwqy";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0b6f4f5c8ddca15e0a1df367bafdffb2f08f1e42f17c78b9470573287e5b20bc";
   };
 
+  # PyPI tarball does not include tests/ directory
   # Unreliable timing: https://github.com/danielperna84/pyhomematic/issues/126
   doCheck = false;
 
diff --git a/pkgs/development/python-modules/pylibconfig2/default.nix b/pkgs/development/python-modules/pylibconfig2/default.nix
new file mode 100644
index 000000000000..6cea70c57089
--- /dev/null
+++ b/pkgs/development/python-modules/pylibconfig2/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, buildPythonPackage, fetchPypi, pyparsing }:
+buildPythonPackage rec {
+  pname = "pylibconfig2";
+  version = "0.2.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1iwm11v0ghv2pq2cyvly7gdwrhxsx6iwi581fz46l0snhgcd4sqq";
+  };
+
+  # tests not included in the distribution
+  doCheck = false;
+
+  propagatedBuildInputs = [ pyparsing ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/heinzK1X/pylibconfig2;
+    description = "Pure python library for libconfig syntax";
+    license = licenses.gpl3;
+  };
+}
diff --git a/pkgs/development/python-modules/pyogg/default.nix b/pkgs/development/python-modules/pyogg/default.nix
new file mode 100644
index 000000000000..08fc87127959
--- /dev/null
+++ b/pkgs/development/python-modules/pyogg/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchPypi, buildPythonPackage, fetchurl, libvorbis, flac, libogg, libopus, opusfile }:
+
+buildPythonPackage rec {
+    pname = "PyOgg";
+    version = "0.6.2a1";
+
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "1mjh5zx7mfy246lya1qc42j4q4pz6v5zbd8blnfib9ncswcb1v6l";
+    };
+
+    buildInputs = [ libvorbis flac libogg libopus ];
+    propagatedBuidInputs = [ libvorbis flac libogg libopus opusfile ];
+    # There are no tests in this package.
+    doCheck = false;
+    postPatch = ''
+      substituteInPlace pyogg/vorbis.py --replace \
+        'libvorbisfile = ExternalLibrary.load("vorbisfile")' "libvorbisfile = ctypes.CDLL('${libvorbis}/lib/libvorbisfile${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/vorbis.py --replace \
+        'libvorbisenc = ExternalLibrary.load("vorbisenc")' "libvorbisenc = ctypes.CDLL('${libvorbis}/lib/libvorbisenc${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/vorbis.py --replace \
+        'libvorbis = ExternalLibrary.load("vorbis")' "libvorbis = ctypes.CDLL('${libvorbis}/lib/libvorbis${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/flac.py --replace \
+        'libflac = ExternalLibrary.load("flac")' "libflac = ctypes.CDLL('${flac.out}/lib/libFLAC${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/ogg.py --replace \
+        'libogg = ExternalLibrary.load("ogg")' "libogg = ctypes.CDLL('${libogg}/lib/libogg${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/opus.py --replace \
+        'libopus = ExternalLibrary.load("opus")' "libopus = ctypes.CDLL('${libopus}/lib/libopus${stdenv.hostPlatform.extensions.sharedLibrary}')"
+      substituteInPlace pyogg/opus.py --replace \
+        'libopusfile = ExternalLibrary.load("opusfile")' "libopusfile = ctypes.CDLL('${opusfile}/lib/libopusfile${stdenv.hostPlatform.extensions.sharedLibrary}')"
+    '';
+
+  meta = {
+    description = "Xiph.org's Ogg Vorbis, Opus and FLAC for Python";
+    homepage = https://github.com/Zuzu-Typ/PyOgg;
+    license = lib.licenses.publicDomain;
+    maintainers = with lib.maintainers; [ pmiddend ];
+  };
+}
diff --git a/pkgs/development/python-modules/pypcap/default.nix b/pkgs/development/python-modules/pypcap/default.nix
index e2d4e1efe285..dc916213fcd0 100644
--- a/pkgs/development/python-modules/pypcap/default.nix
+++ b/pkgs/development/python-modules/pypcap/default.nix
@@ -1,13 +1,12 @@
-{ stdenv, lib, writeText, buildPythonPackage, fetchPypi, libpcap, dpkt }:
+{ lib, writeText, buildPythonPackage, fetchPypi, libpcap, dpkt }:
 
 buildPythonPackage rec {
   pname = "pypcap";
-  version = "1.2.0";
-  name = "${pname}-${version}";
+  version = "1.2.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0n01xjgg8n5mf1cs9yg9ljsx1kvir8cm6wwrd2069fawjxdbk0b9";
+    sha256 = "07ww25z4xydp11hb38halh1940gmp5lca11hwfb63zv3bps248x3";
   };
 
   patches = [
@@ -17,26 +16,24 @@ buildPythonPackage rec {
       ''
       --- a/setup.py
       +++ b/setup.py
-      @@ -27,7 +27,8 @@ def recursive_search(path, target_files):
+      @@ -28,6 +28,7 @@ def recursive_search(path, target_files):
 
-       def get_extension():
-           # A list of all the possible search directories
-      -    dirs = ['/usr', sys.prefix] + glob.glob('/opt/libpcap*') + \
-      +    dirs = ['${libpcap}', '/usr', sys.prefix] + \
-      +        glob.glob('/opt/libpcap*') + \
-               glob.glob('../libpcap*') + glob.glob('../wpdpack*') + \
-               glob.glob('/Applications/Xcode.app/Contents/Developer/Platforms/' +
-                         'MacOSX.platform/Developer/SDKs/*')
+       def find_prefix_and_pcap_h():
+           prefixes = chain.from_iterable((
+      +        '${libpcap}',
+               ('/usr', sys.prefix),
+               glob.glob('/opt/libpcap*'),
+               glob.glob('../libpcap*'),
       '')
   ];
 
   buildInputs = [ libpcap ];
-  nativeBuildInputs = [ dpkt ];
+  checkInputs = [ dpkt ];
 
-  meta = {
+  meta = with lib; {
     homepage = https://github.com/pynetwork/pypcap;
     description = "Simplified object-oriented Python wrapper for libpcap";
-    license = lib.licenses.bsd3;
-    maintainers = with lib.maintainers; [ geistesk ];
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ geistesk ];
   };
 }
diff --git a/pkgs/development/python-modules/pysdl2/PySDL2-dll.patch b/pkgs/development/python-modules/pysdl2/PySDL2-dll.patch
new file mode 100644
index 000000000000..ca723a0e5739
--- /dev/null
+++ b/pkgs/development/python-modules/pysdl2/PySDL2-dll.patch
@@ -0,0 +1,119 @@
+diff -ru PySDL2-0.9.6-old/sdl2/dll.py PySDL2-0.9.6/sdl2/dll.py
+--- PySDL2-0.9.6-old/sdl2/dll.py	2018-03-08 10:18:37.583471745 +0100
++++ PySDL2-0.9.6/sdl2/dll.py	2018-03-08 10:20:06.705517520 +0100
+@@ -45,29 +45,31 @@
+     """Function wrapper around the different DLL functions. Do not use or

+     instantiate this one directly from your user code.

+     """

+-    def __init__(self, libinfo, libnames, path=None):

+-        self._dll = None

+-        foundlibs = _findlib(libnames, path)

+-        dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")

+-        if len(foundlibs) == 0:

+-            raise RuntimeError("could not find any library for %s (%s)" %

+-                               (libinfo, dllmsg))

+-        for libfile in foundlibs:

+-            try:

+-                self._dll = CDLL(libfile)

+-                self._libfile = libfile

+-                break

+-            except Exception as exc:

+-                # Could not load the DLL, move to the next, but inform the user

+-                # about something weird going on - this may become noisy, but

+-                # is better than confusing the users with the RuntimeError below

+-                warnings.warn(repr(exc), DLLWarning)

+-        if self._dll is None:

+-            raise RuntimeError("found %s, but it's not usable for the library %s" %

+-                               (foundlibs, libinfo))

+-        if path is not None and sys.platform in ("win32",) and \

+-            path in self._libfile:

+-            os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])

++    def __init__(self, libfile):

++        self._dll = CDLL(libfile)

++        self._libfile = libfile

++        # self._dll = None

++        # foundlibs = _findlib(libnames, path)

++        # dllmsg = "PYSDL2_DLL_PATH: %s" % (os.getenv("PYSDL2_DLL_PATH") or "unset")

++        # if len(foundlibs) == 0:

++        #     raise RuntimeError("could not find any library for %s (%s)" %

++        #                        (libinfo, dllmsg))

++        # for libfile in foundlibs:

++        #     try:

++        #         self._dll = CDLL(libfile)

++        #         self._libfile = libfile

++        #         break

++        #     except Exception as exc:

++        #         # Could not load the DLL, move to the next, but inform the user

++        #         # about something weird going on - this may become noisy, but

++        #         # is better than confusing the users with the RuntimeError below

++        #         warnings.warn(repr(exc), DLLWarning)

++        # if self._dll is None:

++        #     raise RuntimeError("found %s, but it's not usable for the library %s" %

++        #                        (foundlibs, libinfo))

++        # if path is not None and sys.platform in ("win32",) and \

++        #     path in self._libfile:

++        #     os.environ["PATH"] = "%s;%s" % (path, os.environ["PATH"])

+ 

+     def bind_function(self, funcname, args=None, returns=None, optfunc=None):

+         """Binds the passed argument and return value types to the specified

+@@ -110,7 +112,7 @@
+     return

+ 

+ try:

+-    dll = DLL("SDL2", ["SDL2", "SDL2-2.0"], os.getenv("PYSDL2_DLL_PATH"))

++    dll = DLL("SDL2")

+ except RuntimeError as exc:

+     raise ImportError(exc)

+ 

+diff -ru PySDL2-0.9.6-old/sdl2/sdlgfx.py PySDL2-0.9.6/sdl2/sdlgfx.py
+--- PySDL2-0.9.6-old/sdl2/sdlgfx.py	2018-03-08 10:18:37.585471769 +0100
++++ PySDL2-0.9.6/sdl2/sdlgfx.py	2018-03-08 10:20:06.705517520 +0100
+@@ -34,8 +34,7 @@
+            ]

+ 

+ try:

+-    dll = DLL("SDL2_gfx", ["SDL2_gfx", "SDL2_gfx-1.0"],

+-              os.getenv("PYSDL2_DLL_PATH"))

++    dll = DLL("SDL2_gfx")

+ except RuntimeError as exc:

+     raise ImportError(exc)

+ 

+diff -ru PySDL2-0.9.6-old/sdl2/sdlimage.py PySDL2-0.9.6/sdl2/sdlimage.py
+--- PySDL2-0.9.6-old/sdl2/sdlimage.py	2018-03-08 10:18:37.585471769 +0100
++++ PySDL2-0.9.6/sdl2/sdlimage.py	2018-03-08 10:20:06.705517520 +0100
+@@ -26,8 +26,7 @@
+            ]

+ 

+ try:

+-    dll = DLL("SDL2_image", ["SDL2_image", "SDL2_image-2.0"],

+-              os.getenv("PYSDL2_DLL_PATH"))

++    dll = DLL("SDL2_image")

+ except RuntimeError as exc:

+     raise ImportError(exc)

+ 

+diff -ru PySDL2-0.9.6-old/sdl2/sdlmixer.py PySDL2-0.9.6/sdl2/sdlmixer.py
+--- PySDL2-0.9.6-old/sdl2/sdlmixer.py	2018-03-08 10:18:37.585471769 +0100
++++ PySDL2-0.9.6/sdl2/sdlmixer.py	2018-03-08 10:20:27.415758478 +0100
+@@ -50,8 +50,7 @@
+           ]

+ 

+ try:

+-    dll = DLL("SDL2_mixer", ["SDL2_mixer", "SDL2_mixer-2.0"],

+-              os.getenv("PYSDL2_DLL_PATH"))

++    dll = DLL("SDL2_mixer")

+ except RuntimeError as exc:

+     raise ImportError(exc)

+ 

+diff -ru PySDL2-0.9.6-old/sdl2/sdlttf.py PySDL2-0.9.6/sdl2/sdlttf.py
+--- PySDL2-0.9.6-old/sdl2/sdlttf.py	2018-03-08 10:18:37.585471769 +0100
++++ PySDL2-0.9.6/sdl2/sdlttf.py	2018-03-08 10:20:06.705517520 +0100
+@@ -38,8 +38,7 @@
+           ]

+ 

+ try:

+-    dll = DLL("SDL2_ttf", ["SDL2_ttf", "SDL2_ttf-2.0"],

+-              os.getenv("PYSDL2_DLL_PATH"))

++    dll = DLL("SDL2_ttf")

+ except RuntimeError as exc:

+     raise ImportError(exc)

+ 

diff --git a/pkgs/development/python-modules/pysdl2/default.nix b/pkgs/development/python-modules/pysdl2/default.nix
new file mode 100644
index 000000000000..6681b1b199ad
--- /dev/null
+++ b/pkgs/development/python-modules/pysdl2/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchPypi, buildPythonPackage, fetchurl, SDL2, SDL2_ttf, SDL2_image, SDL2_gfx, SDL2_mixer, pyopengl }:
+
+buildPythonPackage rec {
+  pname = "PySDL2";
+  version = "0.9.6";
+  # The tests use OpenGL using find_library, which would have to be
+  # patched; also they seem to actually open X windows and test stuff
+  # like "screensaver disabling", which would have to be cleverly
+  # sandboxed. Disable for now.
+  doCheck = false;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "08r1v9wdq8pzds4g3sng2xgh1hlzfs2z7qgy5a6b0xrs96swlamm";
+  };
+
+  # Deliberately not in propagated build inputs; users can decide
+  # which library they want to include.
+  buildInputs = [ SDL2_ttf SDL2_image SDL2_gfx SDL2_mixer ];
+  propagatedBuildInputs = [ SDL2 ];
+  patches = [ ./PySDL2-dll.patch ];
+  postPatch = ''
+    substituteInPlace sdl2/dll.py --replace \
+      "DLL(\"SDL2\")" "DLL('${SDL2}/lib/libSDL2${stdenv.hostPlatform.extensions.sharedLibrary}')"
+    substituteInPlace sdl2/sdlttf.py --replace \
+      "DLL(\"SDL2_ttf\")" "DLL('${SDL2_ttf}/lib/libSDL2_ttf${stdenv.hostPlatform.extensions.sharedLibrary}')"
+    substituteInPlace sdl2/sdlimage.py --replace \
+      "DLL(\"SDL2_image\")" "DLL('${SDL2_image}/lib/libSDL2_image${stdenv.hostPlatform.extensions.sharedLibrary}')"
+    substituteInPlace sdl2/sdlgfx.py --replace \
+     "DLL(\"SDL2_gfx\")" "DLL('${SDL2_gfx}/lib/libSDL2_gfx${stdenv.hostPlatform.extensions.sharedLibrary}')"
+    substituteInPlace sdl2/sdlmixer.py --replace \
+     "DLL(\"SDL2_mixer\")" "DLL('${SDL2_mixer}/lib/libSDL2_mixer${stdenv.hostPlatform.extensions.sharedLibrary}')"
+  '';
+
+  meta = {
+    description = "A wrapper around the SDL2 library and as such similar to the discontinued PySDL project";
+    homepage = https://github.com/marcusva/py-sdl2;
+    license = lib.licenses.publicDomain;
+    maintainers = with lib.maintainers; [ pmiddend ];
+  };
+}
diff --git a/pkgs/development/python-modules/pysensors/default.nix b/pkgs/development/python-modules/pysensors/default.nix
new file mode 100644
index 000000000000..c891140827ee
--- /dev/null
+++ b/pkgs/development/python-modules/pysensors/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, buildPythonPackage, python, fetchFromGitHub, lm_sensors }:
+buildPythonPackage rec {
+  version = "2017-07-13";
+  pname = "pysensors";
+
+  # note that https://pypi.org/project/PySensors/ is a different project
+  src = fetchFromGitHub {
+    owner = "bastienleonard";
+    repo = "pysensors";
+    rev = "ef46fc8eb181ecb8ad09b3d80bc002d23d9e26b3";
+    sha256 = "1xvbxnkz55fk5fpr514263c7s7s9r8hgrw4ybfaj5a0mligmmrfm";
+  };
+
+  buildInputs = [ lm_sensors ];
+
+  # Tests are disable because they fail on `aarch64-linux`, probably
+  # due to sandboxing
+  doCheck = false;
+
+  checkPhase = ''
+    cd tests
+    ${python.interpreter} -m unittest discover
+  '';
+
+  meta = with stdenv.lib; {
+    maintainers = with maintainers; [ guibou ];
+    description = "Easy hardware health monitoring in Python for Linux systems";
+    homepage = http://pysensors.readthedocs.org;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix
index c8376196d3ac..b0ac4e070935 100644
--- a/pkgs/development/python-modules/pytorch/default.nix
+++ b/pkgs/development/python-modules/pytorch/default.nix
@@ -1,7 +1,7 @@
-{ buildPythonPackage,
+{ buildPythonPackage, pythonOlder,
   cudaSupport ? false, cudatoolkit ? null, cudnn ? null,
-  fetchFromGitHub, fetchpatch, lib, numpy, pyyaml, cffi, cmake,
-  git, stdenv, linkFarm, symlinkJoin,
+  fetchFromGitHub, fetchpatch, lib, numpy, pyyaml, cffi, typing, cmake,
+  stdenv, linkFarm, symlinkJoin,
   utillinux, which }:
 
 assert cudnn == null || cudatoolkit != null;
@@ -25,7 +25,7 @@ let
     "LD_LIBRARY_PATH=${cudaStub}\${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} ";
 
 in buildPythonPackage rec {
-  version = "0.3.1";
+  version = "0.4.0";
   pname = "pytorch";
   name = "${pname}-${version}";
 
@@ -34,36 +34,17 @@ in buildPythonPackage rec {
     repo   = "pytorch";
     rev    = "v${version}";
     fetchSubmodules = true;
-    sha256 = "1k8fr97v5pf7rni5cr2pi21ixc3pdj3h3lkz28njbjbgkndh7mr3";
+    sha256 = "12d5vqqaprk0igmih7fwa65ldmaawgijxl58h6dnw660wysc132j";
   };
 
-  patches = [
-    (fetchpatch {
-      # make sure stdatomic.h is included when checking for ATOMIC_INT_LOCK_FREE
-      # Fixes this test failure:
-      # RuntimeError: refcounted file mapping not supported on your system at /tmp/nix-build-python3.6-pytorch-0.3.0.drv-0/source/torch/lib/TH/THAllocator.c:525
-      url = "https://github.com/pytorch/pytorch/commit/502aaf39cf4a878f9e4f849e5f409573aa598aa9.patch";
-      stripLen = 3;
-      extraPrefix = "torch/lib/";
-      sha256 = "1miz4lhy3razjwcmhxqa4xmlcmhm65lqyin1czqczj8g16d3f62f";
-    })
-  ];
-
-  postPatch = ''
-    substituteInPlace test/run_test.sh --replace \
-      "INIT_METHOD='file://'\$TEMP_DIR'/shared_init_file' \$PYCMD ./test_distributed.py" \
-      "echo Skipped for Nix package"
-  '';
-
   preConfigure = lib.optionalString cudaSupport ''
-    export CC=${cudatoolkit.cc}/bin/gcc
+    export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
   '' + lib.optionalString (cudaSupport && cudnn != null) ''
     export CUDNN_INCLUDE_DIR=${cudnn}/include
   '';
 
   buildInputs = [
      cmake
-     git
      numpy.blas
      utillinux
      which
@@ -73,10 +54,10 @@ in buildPythonPackage rec {
     cffi
     numpy
     pyyaml
-  ];
+  ] ++ lib.optional (pythonOlder "3.5") typing;
 
   checkPhase = ''
-    ${cudaStubEnv}${stdenv.shell} test/run_test.sh
+    ${cudaStubEnv}python test/run_test.py --exclude distributed
   '';
 
   meta = {
diff --git a/pkgs/development/python-modules/sasmodels/default.nix b/pkgs/development/python-modules/sasmodels/default.nix
index d33de9c2a73a..d84e83299039 100644
--- a/pkgs/development/python-modules/sasmodels/default.nix
+++ b/pkgs/development/python-modules/sasmodels/default.nix
@@ -1,19 +1,25 @@
-{lib, fetchgit, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils}:
+{ lib, fetchFromGitHub, buildPythonPackage, pytest, numpy, scipy, matplotlib, docutils
+, pyopencl, opencl-headers
+}:
 
 buildPythonPackage rec {
-  pname = "sasmodels";
-  version = "0.96";
+  pname = "sasmodels-unstable";
+  version = "2018-04-27";
 
-  buildInputs = [pytest];
-  propagatedBuildInputs = [docutils matplotlib numpy scipy];
+  src = fetchFromGitHub {
+    owner = "SasView";
+    repo = "sasmodels";
+    rev = "33969b656596e8b6cc8ce934cd1f8062f7b11cf2";
+    sha256 = "00rvhafg08qvx0k9mzn1ppdkc9i5yfn2gr3hidrf416srf8zgb85";
+  };
 
-  preCheck = ''export HOME=$(mktemp -d)'';
+  buildInputs = [ opencl-headers ];
+  checkInputs = [ pytest ];
+  propagatedBuildInputs = [ docutils matplotlib numpy scipy pyopencl ];
 
-  src = fetchgit {
-    url = "https://github.com/SasView/sasmodels.git";
-    rev = "v${version}";
-    sha256 = "11qaaqdc23qzb75zs48fkypksmcb332vl0pkjqr5bijxxymgm7nw";
-  };
+  checkPhase = ''
+    HOME=$(mktemp -d) py.test -c ./pytest.ini
+  '';
 
   meta = {
     description = "Library of small angle scattering models";
diff --git a/pkgs/development/python-modules/smmap/default.nix b/pkgs/development/python-modules/smmap/default.nix
new file mode 100644
index 000000000000..366897d3e198
--- /dev/null
+++ b/pkgs/development/python-modules/smmap/default.nix
@@ -0,0 +1,19 @@
+{ lib, fetchPypi, buildPythonPackage, nosexcover }:
+
+buildPythonPackage rec {
+  pname = "smmap";
+  version = "0.9.0";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0qlx25f6n2n9ff37w9gg62f217fzj16xlbh0pkz0lpxxjys64aqf";
+  };
+
+  checkInputs = [ nosexcover ];
+
+  meta = {
+    description = "A pure python implementation of a sliding window memory map manager";
+    homepage = https://github.com/gitpython-developers/smmap;
+    maintainers = [ ];
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/smmap2/default.nix b/pkgs/development/python-modules/smmap2/default.nix
new file mode 100644
index 000000000000..ea0f0859bbd2
--- /dev/null
+++ b/pkgs/development/python-modules/smmap2/default.nix
@@ -0,0 +1,20 @@
+{ lib, fetchPypi, buildPythonPackage, nosexcover }:
+
+buildPythonPackage rec {
+  pname = "smmap2";
+  version = "2.0.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1hvn28p3zvxa98sbi9lrqvv2ps4q284j4jq9a619zw0m7yv0sly7";
+  };
+
+  checkInputs = [ nosexcover ];
+
+  meta = {
+    description = "A pure python implementation of a sliding window memory map manager";
+    homepage = https://pypi.org/project/smmap2;
+    maintainers = [ ];
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/timeout-decorator/default.nix b/pkgs/development/python-modules/timeout-decorator/default.nix
new file mode 100644
index 000000000000..342531ab9764
--- /dev/null
+++ b/pkgs/development/python-modules/timeout-decorator/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+buildPythonPackage rec {
+  pname = "timeout-decorator";
+  version = "0.4.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1bckwbi5078z3x9lyf8vl9dhx10nymwwnp46c98wm5m02x5j37g4";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Timeout decorator";
+    license = licenses.mit;
+    homepage = https://github.com/pnpnpn/timeout-decorator;
+  };
+}
diff --git a/pkgs/development/python-modules/traitlets/default.nix b/pkgs/development/python-modules/traitlets/default.nix
index c34bb09b794c..8cc1332b473f 100644
--- a/pkgs/development/python-modules/traitlets/default.nix
+++ b/pkgs/development/python-modules/traitlets/default.nix
@@ -7,6 +7,8 @@
 , ipython_genutils
 , decorator
 , enum34
+, pythonOlder
+, six
 }:
 
 buildPythonPackage rec {
@@ -20,12 +22,14 @@ buildPythonPackage rec {
   };
 
   checkInputs = [ glibcLocales pytest mock ];
-  propagatedBuildInputs = [ ipython_genutils decorator enum34 ];
+  propagatedBuildInputs = [ ipython_genutils decorator six ] ++ lib.optional (pythonOlder "3.4") enum34;
 
   checkPhase = ''
-    LC_ALL="en_US.UTF-8" py.test $out
+    LC_ALL="en_US.UTF-8" py.test
   '';
 
+#   doCheck = false;
+
   meta = {
     description = "Traitlets Python config system";
     homepage = http://ipython.org/;
diff --git a/pkgs/development/python-modules/trio/default.nix b/pkgs/development/python-modules/trio/default.nix
new file mode 100644
index 000000000000..2bd607170fd5
--- /dev/null
+++ b/pkgs/development/python-modules/trio/default.nix
@@ -0,0 +1,42 @@
+{ lib, buildPythonPackage, fetchPypi, pythonOlder
+, attrs
+, sortedcontainers
+, async_generator
+, idna
+, outcome
+, contextvars
+, pytest
+, pyopenssl
+, trustme
+}:
+
+buildPythonPackage rec {
+  pname = "trio";
+  version = "0.4.0";
+  disabled = pythonOlder "3.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0ib1x47knlad9pljb64ywfiv6m3dfrqqjwka6j1b73hixmszb5h4";
+  };
+
+  checkInputs = [ pytest pyopenssl trustme ];
+  # It appears that the build sandbox doesn't include /etc/services, and these tests try to use it.
+  checkPhase = ''
+    py.test -k 'not test_getnameinfo and not test_SocketType_resolve and not test_getprotobyname'
+  '';
+  propagatedBuildInputs = [
+    attrs
+    sortedcontainers
+    async_generator
+    idna
+    outcome
+  ] ++ lib.optionals (pythonOlder "3.7") [ contextvars ];
+
+  meta = {
+    description = "An async/await-native I/O library for humans and snake people";
+    homepage = https://github.com/python-trio/trio;
+    license = with lib.licenses; [ mit asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/trustme/default.nix b/pkgs/development/python-modules/trustme/default.nix
new file mode 100644
index 000000000000..0c3ccb5258e7
--- /dev/null
+++ b/pkgs/development/python-modules/trustme/default.nix
@@ -0,0 +1,26 @@
+{ lib, buildPythonPackage, fetchPypi, cryptography, pytest, pyopenssl, service-identity }:
+
+buildPythonPackage rec {
+  pname = "trustme";
+  version = "0.4.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1215vr6l6c0fzsv5gyay82fxd4fidvq2rd94wvjrljs6h2wajazk";
+  };
+
+  checkInputs = [ pytest pyopenssl service-identity ];
+  checkPhase = ''
+    py.test
+  '';
+  propagatedBuildInputs = [
+    cryptography
+  ];
+
+  meta = {
+    description = "#1 quality TLS certs while you wait, for the discerning tester";
+    homepage = https://github.com/python-trio/trustme;
+    license = with lib.licenses; [ mit asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/twine/default.nix b/pkgs/development/python-modules/twine/default.nix
index 63f8c3b90554..9cb3a09d363e 100644
--- a/pkgs/development/python-modules/twine/default.nix
+++ b/pkgs/development/python-modules/twine/default.nix
@@ -10,12 +10,12 @@
 
 buildPythonPackage rec {
   pname = "twine";
-  version = "1.9.1";
+  version = "1.11.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "caa45b7987fc96321258cd7668e3be2ff34064f5c66d2d975b641adca659c1ab";
+    sha256 = "09cz9v63f8mrs4znbjapjj2z3wdfryq8q364zm0wzjhbzzcs9n9g";
   };
 
   propagatedBuildInputs = [ pkginfo requests requests_toolbelt tqdm pyblake2 ];
diff --git a/pkgs/development/python-modules/uproot/default.nix b/pkgs/development/python-modules/uproot/default.nix
new file mode 100644
index 000000000000..e58bbde1353f
--- /dev/null
+++ b/pkgs/development/python-modules/uproot/default.nix
@@ -0,0 +1,22 @@
+{lib, fetchPypi, buildPythonPackage, numpy}:
+
+buildPythonPackage rec {
+  pname = "uproot";
+  version = "2.8.23";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "121ggyl5s0q66yrbdfznvzrc793zq1w2xnr3baadlzfvqdlkhgj7";
+  };
+
+  propagatedBuildInputs = [
+    numpy
+  ];
+
+  meta = with lib; {
+    homepage = https://github.com/scikit-hep/uproot;
+    description = "ROOT I/O in pure Python and Numpy";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ktf ];
+  };
+}
diff --git a/pkgs/development/python-modules/uranium/default.nix b/pkgs/development/python-modules/uranium/default.nix
index 774799f3b4d8..0917c5ab6eef 100644
--- a/pkgs/development/python-modules/uranium/default.nix
+++ b/pkgs/development/python-modules/uranium/default.nix
@@ -5,7 +5,7 @@ then throw "Uranium not supported for interpreter ${python.executable}"
 else
 
 stdenv.mkDerivation rec {
-  version = "3.2.1";
+  version = "3.3.0";
   pname = "uranium";
   name = "${pname}-${version}";
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     owner = "Ultimaker";
     repo = "Uranium";
     rev = version;
-    sha256 = "1p05iw1x3rvb51p6hj57yq6nsjawjba3pyyr4jx924iq96vcc3fz";
+    sha256 = "1rg0l2blndnbdfcgkjc2r29cnjdm009rz8lnc225ilh9d7w1srbb";
   };
 
   buildInputs = [ python gettext ];