From a75dd64338b655fca673808359ba563ae8e1986a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 09:48:54 +0200 Subject: [PATCH 1/9] python.pkgs.statsmodels: disable tests --- pkgs/development/python-modules/statsmodels/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/statsmodels/default.nix b/pkgs/development/python-modules/statsmodels/default.nix index 2ef294d8d9f9..f4c74cfccf81 100644 --- a/pkgs/development/python-modules/statsmodels/default.nix +++ b/pkgs/development/python-modules/statsmodels/default.nix @@ -21,9 +21,12 @@ buildPythonPackage rec { sha256 = "26431ab706fbae896db7870a0892743bfbb9f5c83231644692166a31d2d86048"; }; - buildInputs = with self; [ nose ]; + checkInputs = with self; [ nose ]; propagatedBuildInputs = with self; [numpy scipy pandas patsy cython matplotlib]; + # Huge test suites with several test failures + doCheck = false; + meta = { description = "Statistical computations and models for use with SciPy"; homepage = https://www.github.com/statsmodels/statsmodels; From b690856b629bb6ba9ac5f0a3b6abb0de9c1566d1 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 09:52:47 +0200 Subject: [PATCH 2/9] python.pkgs.logfury: fix build --- .../python-modules/logfury/default.nix | 32 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 22 +------------ 2 files changed, 33 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/logfury/default.nix diff --git a/pkgs/development/python-modules/logfury/default.nix b/pkgs/development/python-modules/logfury/default.nix new file mode 100644 index 000000000000..d9ce51eed1ee --- /dev/null +++ b/pkgs/development/python-modules/logfury/default.nix @@ -0,0 +1,32 @@ +{ lib +, buildPythonPackage +, fetchPypi +, funcsigs +, six +}: + +buildPythonPackage rec { + pname = "logfury"; + name = "${pname}-${version}"; + version = "0.1.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "1lywirv3d1lw691mc4mfpz7ak6r49klri43bbfgdnvsfppxminj2"; + }; + + propagatedBuildInputs = [ + funcsigs + six + ]; + + # No tests + doCheck = false; + + meta = { + description = "Logfury is for python library maintainers. It allows for responsible, low-boilerplate logging of method calls."; + homepage = "https://github.com/ppolewicz/logfury"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ jwiegley ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 4d029cbf7add..b9e7dca0528d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7005,27 +7005,7 @@ in { }; }; - logfury = buildPythonPackage rec { - name = "logfury-${version}"; - version = "0.1.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/l/logfury/${name}.tar.gz"; - sha256 = "1lywirv3d1lw691mc4mfpz7ak6r49klri43bbfgdnvsfppxminj2"; - }; - - buildInputs = - [ self.funcsigs - self.six - ]; - - meta = with pkgs.stdenv.lib; { - description = "Logfury is for python library maintainers. It allows for responsible, low-boilerplate logging of method calls."; - homepage = "https://github.com/ppolewicz/logfury"; - license = licenses.bsd3; - maintainers = with maintainers; [ jwiegley ]; - }; - }; + logfury = callPackage ../development/python-modules/logfury { }; ndg-httpsclient = buildPythonPackage rec { version = "0.4.2"; From 69435dfba5e5d8094ba4a8826b4b444f67329287 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 10:01:06 +0200 Subject: [PATCH 3/9] python.pkgs.readme_renderer: init at 17.2 --- .../readme_renderer/default.nix | 36 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 38 insertions(+) create mode 100644 pkgs/development/python-modules/readme_renderer/default.nix diff --git a/pkgs/development/python-modules/readme_renderer/default.nix b/pkgs/development/python-modules/readme_renderer/default.nix new file mode 100644 index 000000000000..af0b64fc3404 --- /dev/null +++ b/pkgs/development/python-modules/readme_renderer/default.nix @@ -0,0 +1,36 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pytest +, bleach +, docutils +, pygments +, six +}: + +buildPythonPackage rec { + pname = "readme_renderer"; + version = "17.2"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "9deab442963a63a71ab494bf581b1c844473995a2357f4b3228a1df1c8cba8da"; + }; + + checkInputs = [ pytest ]; + + propagatedBuildInputs = [ + bleach docutils pygments six + ]; + + checkPhase = '' + py.test + ''; + + meta = { + description = "readme_renderer is a library for rendering readme descriptions for Warehouse"; + homepage = https://github.com/pypa/readme_renderer; + license = lib.licenses.asl20; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b9e7dca0528d..30732a7bd64c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19189,6 +19189,8 @@ in { }; }; + readme_renderer = callPackage ../development/python-modules/readme_renderer { }; + rjsmin = callPackage ../development/python-modules/rjsmin { }; pysolr = buildPythonPackage rec { From 700c95a7067e5ea069f0ef9b8848aa2d16eb75c7 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 10:01:51 +0200 Subject: [PATCH 4/9] python.pkgs.restview: 2.5.2 -> 2.7.0 --- .../python-modules/restview/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 26 +------------- 2 files changed, 35 insertions(+), 25 deletions(-) create mode 100644 pkgs/development/python-modules/restview/default.nix diff --git a/pkgs/development/python-modules/restview/default.nix b/pkgs/development/python-modules/restview/default.nix new file mode 100644 index 000000000000..0f2ce45c885c --- /dev/null +++ b/pkgs/development/python-modules/restview/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchPypi +, docutils +, readme_renderer +, pygments +, mock +}: + +buildPythonPackage rec { + pname = "restview"; + name = "${pname}-${version}"; + version = "2.7.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "e7842100f3de179c68cfe7c2cf56c61509cd6068bc6dd58ab42c0ade5d5f97ec"; + }; + + propagatedBuildInputs = [ docutils readme_renderer pygments ]; + checkInputs = [ mock ]; + + postPatch = '' + # dict order breaking tests + sed -i 's@@...@' src/restview/tests.py + ''; + + meta = { + description = "ReStructuredText viewer"; + homepage = http://mg.pov.lt/restview/; + license = lib.licenses.gpl2; + maintainers = with lib.maintainers; [ koral ]; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 30732a7bd64c..3b307a423132 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19136,31 +19136,7 @@ in { }; - restview = buildPythonPackage rec { - name = "restview-${version}"; - version = "2.5.2"; - - src = pkgs.fetchurl { - url = "mirror://pypi/r/restview/${name}.tar.gz"; - sha256 = "0gmdmnlhiy6lagi17maiz312374hk6g6x90fhjwnbrwxif4r9bd5"; - }; - - propagatedBuildInputs = with self; [ docutils readme pygments ]; - buildInputs = with self; [ mock ]; - - patchPhase = '' - # dict order breaking tests - sed -i 's@@...@' src/restview/tests.py - ''; - - meta = { - description = "ReStructuredText viewer"; - homepage = http://mg.pov.lt/restview/; - license = licenses.gpl2; - platforms = platforms.all; - maintainers = with maintainers; [ koral ]; - }; - }; + restview = callPackage ../development/python-modules/restview { }; readme = buildPythonPackage rec { name = "readme-${version}"; From 85e2083aafc91328e475720e7b0e37b615206e2d Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 10:11:45 +0200 Subject: [PATCH 5/9] python.pkgs.django-multiselectfield: 0.1.3 -> 0.1.8 --- .../django-multiselectfield/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 22 +-------------- 2 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 pkgs/development/python-modules/django-multiselectfield/default.nix diff --git a/pkgs/development/python-modules/django-multiselectfield/default.nix b/pkgs/development/python-modules/django-multiselectfield/default.nix new file mode 100644 index 000000000000..af7af221b9b6 --- /dev/null +++ b/pkgs/development/python-modules/django-multiselectfield/default.nix @@ -0,0 +1,27 @@ +{ lib +, buildPythonPackage +, fetchPypi +, django +}: + +buildPythonPackage rec { + pname = "django-multiselectfield"; + name = "${pname}-${version}"; + version = "0.1.8"; + + src = fetchPypi { + inherit pname version; + sha256 = "52483d23aecbf6b502f9e6806e97da9288d5d7f2a3f99f736390763de68c8fd7"; + }; + + propagatedBuildInputs = [ django ]; + + # No tests + doCheck = false; + + meta = { + description = "django-multiselectfield"; + homepage = "https://github.com/goinnn/django-multiselectfield"; + license = lib.licenses.lgpl3; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3b307a423132..1069d60c6882 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19253,27 +19253,7 @@ in { }; }; - django-multiselectfield = buildPythonPackage rec { - name = "django-multiselectfield-${version}"; - version = "0.1.3"; - - src = pkgs.fetchurl { - url = "mirror://pypi/d/django-multiselectfield/django-multiselectfield-${version}.tar.gz"; - sha256 = "0v7wf82f8688srdsym9ajv1j54bxfxwvydypc03f8xyl4c1raziv"; - }; - - propagatedBuildInputs = with self; [ - - ]; - buildInputs = with self; [ - - ]; - - meta = with stdenv.lib; { - description = "django-multiselectfield"; - homepage = "https://github.com/goinnn/django-multiselectfield"; - }; - }; + django-multiselectfield = callPackage ../development/python-modules/django-multiselectfield { }; reviewboard = buildPythonPackage rec { name = "ReviewBoard-2.5.1.1"; From b7eb4a4f9055d1d0b6891e555b25912d413028a0 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 10:17:55 +0200 Subject: [PATCH 6/9] python.pkgs.fixtures: fix build --- .../python-modules/fixtures/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 17 +--------- 2 files changed, 32 insertions(+), 16 deletions(-) create mode 100644 pkgs/development/python-modules/fixtures/default.nix diff --git a/pkgs/development/python-modules/fixtures/default.nix b/pkgs/development/python-modules/fixtures/default.nix new file mode 100644 index 000000000000..c13eec1baf03 --- /dev/null +++ b/pkgs/development/python-modules/fixtures/default.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pbr +, testtools +, mock +, python +}: + +buildPythonPackage rec { + pname = "fixtures"; + version = "1.4.0"; + name = "${pname}-${version}"; + + src = fetchPypi { + inherit pname version; + sha256 = "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"; + }; + + propagatedBuildInputs = [ pbr testtools mock ]; + + checkPhase = '' + ${python.interpreter} -m testtools.run fixtures.test_suite + ''; + + meta = { + description = "Reusable state for writing clean tests and more"; + homepage = "https://pypi.python.org/pypi/fixtures"; + license = lib.licenses.asl20; + }; +} \ No newline at end of file diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1069d60c6882..6312fb25f4b3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15757,22 +15757,7 @@ in { pbr = callPackage ../development/python-modules/pbr { }; - fixtures = buildPythonPackage rec { - name = "fixtures-1.4.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/f/fixtures/${name}.tar.gz"; - sha256 = "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"; - }; - - buildInputs = with self; [ pbr testtools mock ]; - - meta = { - description = "Reusable state for writing clean tests and more"; - homepage = "https://pypi.python.org/pypi/fixtures"; - license = licenses.asl20; - }; - }; + fixtures = callPackage ../development/python-modules/fixtures { }; pelican = callPackage ../development/python-modules/pelican { inherit (pkgs) glibcLocales pandoc git; From 52932fade011f9761266d04c98aa3550c8f96faa Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 10:18:44 +0200 Subject: [PATCH 7/9] python.pkgs.fixtures: 1.4.0 -> 3.0.0 --- pkgs/development/python-modules/fixtures/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/fixtures/default.nix b/pkgs/development/python-modules/fixtures/default.nix index c13eec1baf03..62741a787099 100644 --- a/pkgs/development/python-modules/fixtures/default.nix +++ b/pkgs/development/python-modules/fixtures/default.nix @@ -9,12 +9,12 @@ buildPythonPackage rec { pname = "fixtures"; - version = "1.4.0"; + version = "3.0.0"; name = "${pname}-${version}"; src = fetchPypi { inherit pname version; - sha256 = "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y"; + sha256 = "fcf0d60234f1544da717a9738325812de1f42c2fa085e2d9252d8fff5712b2ef"; }; propagatedBuildInputs = [ pbr testtools mock ]; From a26ae760e2ebacc5780ebb2906a4c3cc467747c2 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 15:04:47 +0200 Subject: [PATCH 8/9] python.pkgs.setuptools: upgrade to 36.4.0 --- .../development/python-modules/bootstrapped-pip/default.nix | 6 +++--- pkgs/development/python-modules/setuptools/default.nix | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index 3e07806986b1..26db071cad54 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -9,16 +9,16 @@ let }; setuptools_source = fetchPypi { pname = "setuptools"; - version = "36.0.1"; + version = "36.4.0"; format = "wheel"; - sha256 = "f2900e560efc479938a219433c48f15a4ff4ecfe575a65de385eeb44f2425587"; + sha256 = "4d54c0bfee283e78609169213f9c075827d5837086f58b588b417b093c23464b"; }; # TODO: Shouldn't be necessary anymore for pip > 9.0.1! # https://github.com/NixOS/nixpkgs/issues/26392 # https://github.com/pypa/setuptools/issues/885 pkg_resources = fetchurl { - url = https://raw.githubusercontent.com/pypa/setuptools/v36.0.1/pkg_resources/__init__.py; + url = "https://raw.githubusercontent.com/pypa/setuptools/v36.4.0/pkg_resources/__init__.py"; sha256 = "1wdnq3mammk75mifkdmmjx7yhnpydvnvi804na8ym4mj934l2jkv"; }; diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix index b6bf629e7467..1c6fb414a73b 100644 --- a/pkgs/development/python-modules/setuptools/default.nix +++ b/pkgs/development/python-modules/setuptools/default.nix @@ -8,13 +8,13 @@ # Should use buildPythonPackage here somehow stdenv.mkDerivation rec { pname = "setuptools"; - version = "36.2.7"; + version = "36.4.0"; name = "${python.libPrefix}-${pname}-${version}"; src = fetchPypi { inherit pname version; extension = "zip"; - sha256 = "b0fe5d432d922df595e918577c51458d63f245115d141b309ac32ecfca329df5"; + sha256 = "2758b0270fe8ceec42f336ee5b411e60dc8579febc27bb3ba9b794dc7f0239ae"; }; buildInputs = [ python wrapPython unzip ]; From b73e3bfafd42dbc9caca2eae918ce936c9471c23 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 7 Sep 2017 19:22:06 +0200 Subject: [PATCH 9/9] python.pkgs.buildPythonPackage: use distutils-cfg to block downloads, fixes #25428 While we tell pip not to fetch (with the `--no-index` option), `setuptools` can do so itself. In the past we used a `distutils.cfg` with `allow-hosts = None` to prevent setuptools from fetching itself. This was removed when we started building wheels in 2562f94de4e4fd2ddc677187fa2e2848L69. The `dist-utils.cfg` code was still there, and adding it to `buildInputs` is sufficient. Tested with python.pkgs.passlib by removing the `checkInputs` / `nose`. --- pkgs/development/interpreters/python/mk-python-derivation.nix | 4 +++- pkgs/top-level/python-packages.nix | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index bc586e0b3cee..dae465edc0d8 100644 --- a/pkgs/development/interpreters/python/mk-python-derivation.nix +++ b/pkgs/development/interpreters/python/mk-python-derivation.nix @@ -6,6 +6,8 @@ , setuptools , unzip , ensureNewerSourcesHook +# Prevent impurities by blocking setuptools/easy-install from downloading sdists +, distutils-cfg }: { name @@ -60,7 +62,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "checkInputs" inherit pythonPath; - buildInputs = [ wrapPython ] ++ buildInputs ++ pythonPath + buildInputs = [ distutils-cfg wrapPython ] ++ buildInputs ++ pythonPath ++ [ (ensureNewerSourcesHook { year = "1980"; }) ] ++ (lib.optional (lib.hasSuffix "zip" attrs.src.name or "") unzip) ++ lib.optionals doCheck checkInputs; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6312fb25f4b3..4a63203c551d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -34,6 +34,7 @@ let bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { }; mkPythonDerivation = makeOverridable( callPackage ../development/interpreters/python/mk-python-derivation.nix { + distutils-cfg = callPackage ../development/python-modules/distutils-cfg { }; }); # Derivations built with `buildPythonPackage` can already be overriden with `override`, `overrideAttrs`, and `overrideDerivation`.