about summary refs log tree commit diff
path: root/pkgs/development/python-modules
diff options
context:
space:
mode:
authorOrivej Desh <orivej@gmx.fr>2017-11-17 05:35:09 +0000
committerOrivej Desh <orivej@gmx.fr>2017-11-17 05:35:09 +0000
commitd99a2fc093c1bffd41f0008689cd2be4f1b7dea6 (patch)
tree827becf0bb8f449b71439a22a1746698eb175612 /pkgs/development/python-modules
parent020a6663d319c7b4af5c0219bc451abdac12f62a (diff)
parent3ac474aee6ac977f67fa4ffd35da8af56df5fba8 (diff)
downloadnixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar.gz
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar.bz2
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar.lz
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar.xz
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.tar.zst
nixlib-d99a2fc093c1bffd41f0008689cd2be4f1b7dea6.zip
Merge branch 'master' into staging
* master: (293 commits)
  go_1_9: skip flaky TestServerCancelsReadTimeoutWhenIdle
  qsyncthingtray: fix build
  qt56.qtwebengine: fix build
  stdman: d860212 -> 2017.04.02
  jackett: use mono50
  hg-git: disable with python3
  hg-git: 0.8.5 -> 0.8.10
  xfce4-settings: enable parallel building
  gcc-snapshot: mark as broken
  heaptrack: 2017-02-14 -> 2017-10-30
  nixos-container: Modify existing test to cover show-ip command
  nixos-container: Make show-ip work together with ipv4 + netmask
  linux-copperhead: 4.13.12.a -> 4.13.13.a
  matterbridge: 1.1.0 -> 1.4.1
  nixos/nghttpx: add module for the nghttpx proxy server (#31680)
  mattermost: 4.3.0 -> 4.4.0
  breakpad: delete
  simp_le: 0.2.0 -> 0.6.1
  certbot: 0.11.1 -> 0.19.0
  afl: 2.51b -> 2.52b
  ...
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r--pkgs/development/python-modules/absl-py/default.nix28
-rw-r--r--pkgs/development/python-modules/mpi4py/default.nix30
-rw-r--r--pkgs/development/python-modules/mpyq/default.nix22
-rw-r--r--pkgs/development/python-modules/pip-tools/default.nix21
-rw-r--r--pkgs/development/python-modules/portpicker/default.nix22
-rw-r--r--pkgs/development/python-modules/pypcap/default.nix10
-rw-r--r--pkgs/development/python-modules/pyqt/5.x.nix8
-rw-r--r--pkgs/development/python-modules/pysc2/default.nix64
-rw-r--r--pkgs/development/python-modules/pysc2/fix-setup-for-py3.patch64
-rw-r--r--pkgs/development/python-modules/pysc2/parameterize-runconfig-sc2path.patch18
-rw-r--r--pkgs/development/python-modules/qtawesome/default.nix19
-rw-r--r--pkgs/development/python-modules/qtpy/default.nix25
-rw-r--r--pkgs/development/python-modules/rope/default.nix18
-rw-r--r--pkgs/development/python-modules/s2clientprotocol/default.nix27
-rw-r--r--pkgs/development/python-modules/s2clientprotocol/pure-version.patch13
15 files changed, 349 insertions, 40 deletions
diff --git a/pkgs/development/python-modules/absl-py/default.nix b/pkgs/development/python-modules/absl-py/default.nix
new file mode 100644
index 000000000000..3f37820fd35f
--- /dev/null
+++ b/pkgs/development/python-modules/absl-py/default.nix
@@ -0,0 +1,28 @@
+{ buildPythonPackage
+, lib
+, fetchPypi
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "absl-py";
+  version = "0.1.3";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "017wc85i7l3vpjzw3shgb7k7n0jfid88g09dlf1kgdy4ll0sjfax";
+  };
+
+  propagatedBuildInputs = [ six ];
+
+  # checks use bazel; should be revisited
+  doCheck = false;
+
+  meta = {
+    description = "Abseil Python Common Libraries";
+    homepage = "https://github.com/abseil/abseil-py";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/pkgs/development/python-modules/mpi4py/default.nix b/pkgs/development/python-modules/mpi4py/default.nix
index 7e54240941d6..fcbca62ff9df 100644
--- a/pkgs/development/python-modules/mpi4py/default.nix
+++ b/pkgs/development/python-modules/mpi4py/default.nix
@@ -1,35 +1,19 @@
-{ stdenv, fetchPypi, python, buildPythonPackage, mpi, openssh, isPy3k, isPyPy }:
+{ stdenv, fetchPypi, python, buildPythonPackage, mpi }:
 
 buildPythonPackage rec {
   pname = "mpi4py";
-  version = "2.0.0";
+  version = "3.0.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "10fb01595rg17ycz08a23v24akm25d13srsy2rnixam7a5ca0hv5";
+    sha256 = "1mzgd26dfv4vwbci8gq77ss9f0x26i9aqzq9b9vs9ndxhlnv0mxl";
   };
 
   passthru = {
     inherit mpi;
   };
 
-  # Rename libm.so -> libm.so.6 in test
-  # See: https://bitbucket.org/mpi4py/mpi4py/issues/28/test_dltestdl-test-failure
-  patches = [
-    ./tests.patch
-  ];
-
-  # The tests in the `test_spawn` module fail in the chroot build environment.
-  # However, they do pass in a pure, or non-pure nix-shell. Hence, we
-  # deactivate these particular tests.
-  # Unfortunately, the command-line arguments to `./setup.py test` are not
-  # correctly passed to the test-runner. Hence, these arguments are patched
-  # directly into `setup.py`.
-  prePatch = ''
-    sed 's/err = main(cmd.args or \[\])/err = main(cmd.args or ["-v", "-e", "test_spawn"])/' -i setup.py
-  '';
-
   configurePhase = "";
 
   installPhase = ''
@@ -49,14 +33,6 @@ buildPythonPackage rec {
   setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"];
 
   buildInputs = [ mpi ];
-  # Requires openssh for tests. Tests of dependent packages will also fail,
-  # if openssh is not present. E.g. h5py with mpi support.
-  propagatedBuildInputs = [ openssh ];
-
-  disabled = isPy3k || isPyPy;
-
-  # Timing out communicating between processes when sandboxing enabled.
-  doCheck = false;
 
   meta = {
     description =
diff --git a/pkgs/development/python-modules/mpyq/default.nix b/pkgs/development/python-modules/mpyq/default.nix
new file mode 100644
index 000000000000..2be1c34c01c8
--- /dev/null
+++ b/pkgs/development/python-modules/mpyq/default.nix
@@ -0,0 +1,22 @@
+{ buildPythonPackage
+, lib
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "mpyq";
+  version = "0.2.5";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "01q0xh2fy3zzsrfr45d2ypj4whs7s060cy1rnprg6sg55fbgbaih";
+  };
+
+  meta = {
+    description = "A Python library for extracting MPQ (MoPaQ) files.";
+    homepage = "https://github.com/eagleflo/mpyq";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix
index d916f9b95b1d..eed891c6f577 100644
--- a/pkgs/development/python-modules/pip-tools/default.nix
+++ b/pkgs/development/python-modules/pip-tools/default.nix
@@ -15,15 +15,26 @@ buildPythonPackage rec {
   checkInputs = [ pytest git glibcLocales mock ];
   propagatedBuildInputs = [ pip click six first setuptools_scm ];
 
+  disabledTests = stdenv.lib.concatMapStringsSep " and " (s: "not " + s) [
+    # Depend on network tests:
+    "test_editable_package_vcs"
+    "test_generate_hashes_all_platforms"
+    "test_generate_hashes_without_interfering_with_each_other"
+    "test_realistic_complex_sub_dependencies"
+    # Expect specific version of "six":
+    "test_editable_package"
+    "test_input_file_without_extension"
+  ];
+
   checkPhase = ''
     export HOME=$(mktemp -d) VIRTUAL_ENV=1
     tests_without_network_access="
-      not test_realistic_complex_sub_dependencies \
-      and not test_editable_package_vcs \
-      and not test_generate_hashes_all_platforms \
-      and not test_generate_hashes_without_interfering_with_each_other \
+      not test_realistic_complex_sub_dependencies
+      and not test_editable_package_vcs
+      and not test_generate_hashes_all_platforms
+      and not test_generate_hashes_without_interfering_with_each_other
     "
-    py.test -k "$tests_without_network_access"
+    py.test -k "${disabledTests}"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/portpicker/default.nix b/pkgs/development/python-modules/portpicker/default.nix
new file mode 100644
index 000000000000..3e753ab7e06b
--- /dev/null
+++ b/pkgs/development/python-modules/portpicker/default.nix
@@ -0,0 +1,22 @@
+{ buildPythonPackage
+, lib
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "portpicker";
+  version = "1.2.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0c1lm3i4yngi1qclb0hny19vwjd2si5k2qni30wcrnxqqasqak1y";
+  };
+
+  meta = {
+    description = "A library to choose unique available network ports.";
+    homepage = "https://github.com/google/python_portpicker";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/pkgs/development/python-modules/pypcap/default.nix b/pkgs/development/python-modules/pypcap/default.nix
index ab4c5f6034fe..e2d4e1efe285 100644
--- a/pkgs/development/python-modules/pypcap/default.nix
+++ b/pkgs/development/python-modules/pypcap/default.nix
@@ -1,14 +1,13 @@
-{ stdenv, lib, writeText, buildPythonPackage, fetchPypi, isPy3k, libpcap, dpkt }:
+{ stdenv, lib, writeText, buildPythonPackage, fetchPypi, libpcap, dpkt }:
 
 buildPythonPackage rec {
   pname = "pypcap";
-  version = "1.1.6";
+  version = "1.2.0";
   name = "${pname}-${version}";
-  disabled = isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1cx7qm0w2a91g5z8k3kmlwz0b8dkr0h8dlb64rwgyhp2laa33syi";
+    sha256 = "0n01xjgg8n5mf1cs9yg9ljsx1kvir8cm6wwrd2069fawjxdbk0b9";
   };
 
   patches = [
@@ -31,7 +30,8 @@ buildPythonPackage rec {
       '')
   ];
 
-  buildInputs = [ libpcap dpkt ];
+  buildInputs = [ libpcap ];
+  nativeBuildInputs = [ dpkt ];
 
   meta = {
     homepage = https://github.com/pynetwork/pypcap;
diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix
index 9c1489aba02f..2db0c4412544 100644
--- a/pkgs/development/python-modules/pyqt/5.x.nix
+++ b/pkgs/development/python-modules/pyqt/5.x.nix
@@ -1,5 +1,7 @@
-{ lib, fetchurl, pythonPackages, pkgconfig, qtbase, qtsvg, qtwebkit, qtwebengine, dbus_libs
-, lndir, makeWrapper, qmake }:
+{ lib, fetchurl, pythonPackages, pkgconfig, makeWrapper, qmake
+, lndir, qtbase, qtsvg, qtwebkit, qtwebengine, dbus_libs
+, withWebSockets ? false, qtwebsockets
+}:
 
 let
   version = "5.9";
@@ -25,7 +27,7 @@ in buildPythonPackage {
 
   buildInputs = [
     lndir qtbase qtsvg qtwebkit qtwebengine dbus_libs
-  ];
+  ] ++ lib.optional withWebSockets qtwebsockets;
 
   propagatedBuildInputs = [ sip ];
 
diff --git a/pkgs/development/python-modules/pysc2/default.nix b/pkgs/development/python-modules/pysc2/default.nix
new file mode 100644
index 000000000000..a2dfd53b7951
--- /dev/null
+++ b/pkgs/development/python-modules/pysc2/default.nix
@@ -0,0 +1,64 @@
+{ buildPythonPackage
+, lib
+, fetchFromGitHub
+, absl-py
+, enum34
+, future
+, futures
+, mock
+, mpyq
+, numpy
+, portpicker
+, protobuf
+, pygame
+, s2clientprotocol
+, six
+, websocket_client
+, sc2-headless
+}:
+
+buildPythonPackage rec {
+  version = "1.2";
+  name = "PySC2-${version}";
+
+  src = fetchFromGitHub {
+    owner = "deepmind";
+    repo = "pysc2";
+    rev = "39f84b01d662eb58b3d95791f59208c210afd4e7";
+    sha256 = "0dfbc2krd2rys1ji75ng2nl0ki8nhnylxljcp287bfb8qyz2m25p";
+  };
+
+  patches = [
+    ./fix-setup-for-py3.patch
+    ./parameterize-runconfig-sc2path.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace "./pysc2/run_configs/platforms.py" \
+      --subst-var-by 'sc2path' '${sc2-headless}'
+  '';
+
+  propagatedBuildInputs = [
+    absl-py
+    enum34
+    future
+    mock
+    mpyq
+    numpy
+    portpicker
+    protobuf
+    pygame
+    s2clientprotocol
+    six
+    websocket_client
+    sc2-headless
+  ];
+
+  meta = {
+    description = "Starcraft II environment and library for training agents.";
+    homepage = "https://github.com/deepmind/pysc2";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/pkgs/development/python-modules/pysc2/fix-setup-for-py3.patch b/pkgs/development/python-modules/pysc2/fix-setup-for-py3.patch
new file mode 100644
index 000000000000..b1a2b4e2350a
--- /dev/null
+++ b/pkgs/development/python-modules/pysc2/fix-setup-for-py3.patch
@@ -0,0 +1,64 @@
+diff --git a/setup.py b/setup.py
+index 020768f..13c2b67 100755
+--- a/setup.py
++++ b/setup.py
+@@ -17,6 +17,8 @@ from __future__ import absolute_import
+ from __future__ import division
+ from __future__ import print_function
+ 
++import sys
++
+ from setuptools import setup
+ 
+ description = """PySC2 - StarCraft II Learning Environment
+@@ -36,6 +38,27 @@ some initial research results using the environment.
+ Read the README at https://github.com/deepmind/pysc2 for more information.
+ """
+ 
++requires = [
++    'absl-py>=0.1.0',
++    'future',
++    'mock',
++    'mpyq',
++    'numpy>=1.10',
++    'portpicker>=1.2.0',
++    'protobuf>=2.6',
++    'pygame',
++    's2clientprotocol>=3.19.0.58400.0',
++    'six',
++    'websocket-client',
++]
++
++if sys.version_info[0] == 2:
++    requires.append('futures')
++
++if (sys.version_info[0] == 2
++        or (sys.version_info[0] == 3 and sys.version_info[1] < 4)):
++    requires.append('enum34')
++
+ setup(
+     name='PySC2',
+     version='1.2',
+@@ -56,21 +79,7 @@ setup(
+         'pysc2.run_configs',
+         'pysc2.tests',
+     ],
+-    install_requires=[
+-        'absl-py>=0.1.0',
+-        'enum34',
+-        'future',
+-        'futures',
+-        'mock',
+-        'mpyq',
+-        'numpy>=1.10',
+-        'portpicker>=1.2.0',
+-        'protobuf>=2.6',
+-        'pygame',
+-        's2clientprotocol>=3.19.0.58400.0',
+-        'six',
+-        'websocket-client',
+-    ],
++    install_requires=requires,
+     entry_points={
+         'console_scripts': [
+             'pysc2_agent = pysc2.bin.agent:entry_point',
diff --git a/pkgs/development/python-modules/pysc2/parameterize-runconfig-sc2path.patch b/pkgs/development/python-modules/pysc2/parameterize-runconfig-sc2path.patch
new file mode 100644
index 000000000000..be667503d47c
--- /dev/null
+++ b/pkgs/development/python-modules/pysc2/parameterize-runconfig-sc2path.patch
@@ -0,0 +1,18 @@
+diff --git a/pysc2/run_configs/platforms.py b/pysc2/run_configs/platforms.py
+index 5cd84f9..1923cb7 100644
+--- a/pysc2/run_configs/platforms.py
++++ b/pysc2/run_configs/platforms.py
+@@ -119,12 +119,9 @@ class Linux(LocalBase):
+   """Config to run on Linux."""
+ 
+   def __init__(self):
+-    base_dir = os.environ.get("SC2PATH", "~/StarCraftII")
++    base_dir = os.environ.get("SC2PATH", "@sc2path@")
+     base_dir = os.path.expanduser(base_dir)
+     env = copy.deepcopy(os.environ)
+-    env["LD_LIBRARY_PATH"] = ":".join(filter(None, [
+-        os.environ.get("LD_LIBRARY_PATH"),
+-        os.path.join(base_dir, "Libs/")]))
+     super(Linux, self).__init__(base_dir, "SC2_x64", env=env)
+ 
+   @classmethod
diff --git a/pkgs/development/python-modules/qtawesome/default.nix b/pkgs/development/python-modules/qtawesome/default.nix
new file mode 100644
index 000000000000..016266dd8544
--- /dev/null
+++ b/pkgs/development/python-modules/qtawesome/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, buildPythonPackage, fetchPypi, qtpy, six, pyside }:
+
+buildPythonPackage rec {
+  pname = "QtAwesome";
+  version = "0.4.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "12l71wh9fcd79d6c7qfzp029iph6gv4daxpg2ddpzr9lrvcw3yah";
+  };
+
+  propagatedBuildInputs = [ qtpy six pyside ];
+
+  meta = with stdenv.lib; {
+    description = "Iconic fonts in PyQt and PySide applications";
+    homepage = https://github.com/spyder-ide/qtawesome;
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/qtpy/default.nix b/pkgs/development/python-modules/qtpy/default.nix
new file mode 100644
index 000000000000..035ea32b3989
--- /dev/null
+++ b/pkgs/development/python-modules/qtpy/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, buildPythonPackage, fetchPypi, pyside, pytest }:
+
+buildPythonPackage rec {
+  pname = "QtPy";
+  version = "1.3.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "04skhjb2dbbhvpq0x71nnz2h68805fkxfpkdjhwvd7lzsljjbbq8";
+  };
+
+  # no concrete propagatedBuildInputs as multiple backends are supposed
+  checkInputs = [ pyside pytest ];
+
+  doCheck = false; # require X
+  checkPhase = ''
+    py.test qtpy/tests
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Abstraction layer for PyQt5/PyQt4/PySide2/PySide";
+    homepage = https://github.com/spyder-ide/qtpy;
+    license = licenses.mit;
+  };
+}
diff --git a/pkgs/development/python-modules/rope/default.nix b/pkgs/development/python-modules/rope/default.nix
new file mode 100644
index 000000000000..db08ad2a5c03
--- /dev/null
+++ b/pkgs/development/python-modules/rope/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "rope";
+  version = "0.10.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1lc01pjn0yr6yqcpbf6kk170zg8zhnyzj8kqlsch1mag0g9dz7m0";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Python refactoring library";
+    homepage = https://github.com/python-rope/rope;
+    maintainers = with maintainers; [ goibhniu ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/development/python-modules/s2clientprotocol/default.nix b/pkgs/development/python-modules/s2clientprotocol/default.nix
new file mode 100644
index 000000000000..3c24a7e522d0
--- /dev/null
+++ b/pkgs/development/python-modules/s2clientprotocol/default.nix
@@ -0,0 +1,27 @@
+{ buildPythonPackage
+, lib
+, fetchPypi
+, protobuf
+}:
+
+buildPythonPackage rec {
+  pname = "s2clientprotocol";
+  version = "3.19.1.58600.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "02jqwdfj5zpag4c5nf0707qmwk7sqm98yfgrd19rq6pi58zgl74f";
+  };
+
+  patches = [ ./pure-version.patch ];
+
+  buildInputs = [ protobuf ];
+
+  meta = {
+    description = "StarCraft II - client protocol.";
+    homepage = "https://github.com/Blizzard/sc2client-proto";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/pkgs/development/python-modules/s2clientprotocol/pure-version.patch b/pkgs/development/python-modules/s2clientprotocol/pure-version.patch
new file mode 100644
index 000000000000..43675c3bb11c
--- /dev/null
+++ b/pkgs/development/python-modules/s2clientprotocol/pure-version.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 89131a8..19527df 100755
+--- a/setup.py
++++ b/setup.py
+@@ -13,8 +13,6 @@ from distutils.spawn import find_executable
+ from setuptools import setup
+ from setuptools.command.build_py import build_py
+ 
+-import gameversion_autogen as ver
+-
+ SETUP_DIR = os.path.dirname(os.path.abspath(__file__))
+ PROTO_DIR = os.path.join(SETUP_DIR, 's2clientprotocol')
+