Skip to content

Commit 32f2ead

Browse files
committedSep 7, 2017
Merge pull request #29072 from FRidh/python-fixes-3
Python: several fixes (3) (cherry picked from commit 56c56fb)
1 parent 4e6c92d commit 32f2ead

File tree

10 files changed

+179
-90
lines changed

10 files changed

+179
-90
lines changed
 

Diff for: ‎pkgs/development/interpreters/python/mk-python-derivation.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
, setuptools
77
, unzip
88
, ensureNewerSourcesHook
9+
# Prevent impurities by blocking setuptools/easy-install from downloading sdists
10+
, distutils-cfg
911
}:
1012

1113
{ name
@@ -60,7 +62,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "checkInputs"
6062

6163
inherit pythonPath;
6264

63-
buildInputs = [ wrapPython ] ++ buildInputs ++ pythonPath
65+
buildInputs = [ distutils-cfg wrapPython ] ++ buildInputs ++ pythonPath
6466
++ [ (ensureNewerSourcesHook { year = "1980"; }) ]
6567
++ (lib.optional (lib.hasSuffix "zip" attrs.src.name or "") unzip)
6668
++ lib.optionals doCheck checkInputs;

Diff for: ‎pkgs/development/python-modules/bootstrapped-pip/default.nix

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ let
99
};
1010
setuptools_source = fetchPypi {
1111
pname = "setuptools";
12-
version = "36.0.1";
12+
version = "36.4.0";
1313
format = "wheel";
14-
sha256 = "f2900e560efc479938a219433c48f15a4ff4ecfe575a65de385eeb44f2425587";
14+
sha256 = "4d54c0bfee283e78609169213f9c075827d5837086f58b588b417b093c23464b";
1515
};
1616

1717
# TODO: Shouldn't be necessary anymore for pip > 9.0.1!
1818
# https://github.com/NixOS/nixpkgs/issues/26392
1919
# https://github.com/pypa/setuptools/issues/885
2020
pkg_resources = fetchurl {
21-
url = https://raw.githubusercontent.com/pypa/setuptools/v36.0.1/pkg_resources/__init__.py;
21+
url = "https://raw.githubusercontent.com/pypa/setuptools/v36.4.0/pkg_resources/__init__.py";
2222
sha256 = "1wdnq3mammk75mifkdmmjx7yhnpydvnvi804na8ym4mj934l2jkv";
2323
};
2424

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
, django
5+
}:
6+
7+
buildPythonPackage rec {
8+
pname = "django-multiselectfield";
9+
name = "${pname}-${version}";
10+
version = "0.1.8";
11+
12+
src = fetchPypi {
13+
inherit pname version;
14+
sha256 = "52483d23aecbf6b502f9e6806e97da9288d5d7f2a3f99f736390763de68c8fd7";
15+
};
16+
17+
propagatedBuildInputs = [ django ];
18+
19+
# No tests
20+
doCheck = false;
21+
22+
meta = {
23+
description = "django-multiselectfield";
24+
homepage = "https://github.com/goinnn/django-multiselectfield";
25+
license = lib.licenses.lgpl3;
26+
};
27+
}

Diff for: ‎pkgs/development/python-modules/fixtures/default.nix

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
, pbr
5+
, testtools
6+
, mock
7+
, python
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "fixtures";
12+
version = "3.0.0";
13+
name = "${pname}-${version}";
14+
15+
src = fetchPypi {
16+
inherit pname version;
17+
sha256 = "fcf0d60234f1544da717a9738325812de1f42c2fa085e2d9252d8fff5712b2ef";
18+
};
19+
20+
propagatedBuildInputs = [ pbr testtools mock ];
21+
22+
checkPhase = ''
23+
${python.interpreter} -m testtools.run fixtures.test_suite
24+
'';
25+
26+
meta = {
27+
description = "Reusable state for writing clean tests and more";
28+
homepage = "https://pypi.python.org/pypi/fixtures";
29+
license = lib.licenses.asl20;
30+
};
31+
}

Diff for: ‎pkgs/development/python-modules/logfury/default.nix

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
, funcsigs
5+
, six
6+
}:
7+
8+
buildPythonPackage rec {
9+
pname = "logfury";
10+
name = "${pname}-${version}";
11+
version = "0.1.2";
12+
13+
src = fetchPypi {
14+
inherit pname version;
15+
sha256 = "1lywirv3d1lw691mc4mfpz7ak6r49klri43bbfgdnvsfppxminj2";
16+
};
17+
18+
propagatedBuildInputs = [
19+
funcsigs
20+
six
21+
];
22+
23+
# No tests
24+
doCheck = false;
25+
26+
meta = {
27+
description = "Logfury is for python library maintainers. It allows for responsible, low-boilerplate logging of method calls.";
28+
homepage = "https://github.com/ppolewicz/logfury";
29+
license = lib.licenses.bsd3;
30+
maintainers = with lib.maintainers; [ jwiegley ];
31+
};
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
, pytest
5+
, bleach
6+
, docutils
7+
, pygments
8+
, six
9+
}:
10+
11+
buildPythonPackage rec {
12+
pname = "readme_renderer";
13+
version = "17.2";
14+
name = "${pname}-${version}";
15+
16+
src = fetchPypi {
17+
inherit pname version;
18+
sha256 = "9deab442963a63a71ab494bf581b1c844473995a2357f4b3228a1df1c8cba8da";
19+
};
20+
21+
checkInputs = [ pytest ];
22+
23+
propagatedBuildInputs = [
24+
bleach docutils pygments six
25+
];
26+
27+
checkPhase = ''
28+
py.test
29+
'';
30+
31+
meta = {
32+
description = "readme_renderer is a library for rendering readme descriptions for Warehouse";
33+
homepage = https://github.com/pypa/readme_renderer;
34+
license = lib.licenses.asl20;
35+
};
36+
}

Diff for: ‎pkgs/development/python-modules/restview/default.nix

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{ lib
2+
, buildPythonPackage
3+
, fetchPypi
4+
, docutils
5+
, readme_renderer
6+
, pygments
7+
, mock
8+
}:
9+
10+
buildPythonPackage rec {
11+
pname = "restview";
12+
name = "${pname}-${version}";
13+
version = "2.7.0";
14+
15+
src = fetchPypi {
16+
inherit pname version;
17+
sha256 = "e7842100f3de179c68cfe7c2cf56c61509cd6068bc6dd58ab42c0ade5d5f97ec";
18+
};
19+
20+
propagatedBuildInputs = [ docutils readme_renderer pygments ];
21+
checkInputs = [ mock ];
22+
23+
postPatch = ''
24+
# dict order breaking tests
25+
sed -i 's@<a href="http://www.example.com" rel="nofollow">@...@' src/restview/tests.py
26+
'';
27+
28+
meta = {
29+
description = "ReStructuredText viewer";
30+
homepage = http://mg.pov.lt/restview/;
31+
license = lib.licenses.gpl2;
32+
maintainers = with lib.maintainers; [ koral ];
33+
};
34+
}

Diff for: ‎pkgs/development/python-modules/setuptools/default.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
# Should use buildPythonPackage here somehow
99
stdenv.mkDerivation rec {
1010
pname = "setuptools";
11-
version = "36.2.7";
11+
version = "36.4.0";
1212
name = "${python.libPrefix}-${pname}-${version}";
1313

1414
src = fetchPypi {
1515
inherit pname version;
1616
extension = "zip";
17-
sha256 = "b0fe5d432d922df595e918577c51458d63f245115d141b309ac32ecfca329df5";
17+
sha256 = "2758b0270fe8ceec42f336ee5b411e60dc8579febc27bb3ba9b794dc7f0239ae";
1818
};
1919

2020
buildInputs = [ python wrapPython unzip ];

Diff for: ‎pkgs/development/python-modules/statsmodels/default.nix

+4-1
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ buildPythonPackage rec {
2121
sha256 = "26431ab706fbae896db7870a0892743bfbb9f5c83231644692166a31d2d86048";
2222
};
2323

24-
buildInputs = with self; [ nose ];
24+
checkInputs = with self; [ nose ];
2525
propagatedBuildInputs = with self; [numpy scipy pandas patsy cython matplotlib];
2626

27+
# Huge test suites with several test failures
28+
doCheck = false;
29+
2730
meta = {
2831
description = "Statistical computations and models for use with SciPy";
2932
homepage = https://www.github.com/statsmodels/statsmodels;

Diff for: ‎pkgs/top-level/python-packages.nix

+7-83
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ let
3434
bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
3535

3636
mkPythonDerivation = makeOverridable( callPackage ../development/interpreters/python/mk-python-derivation.nix {
37+
distutils-cfg = callPackage ../development/python-modules/distutils-cfg { };
3738
});
3839

3940
# Derivations built with `buildPythonPackage` can already be overriden with `override`, `overrideAttrs`, and `overrideDerivation`.
@@ -6997,27 +6998,7 @@ in {
69976998
};
69986999
};
69997000

7000-
logfury = buildPythonPackage rec {
7001-
name = "logfury-${version}";
7002-
version = "0.1.2";
7003-
7004-
src = pkgs.fetchurl {
7005-
url = "mirror://pypi/l/logfury/${name}.tar.gz";
7006-
sha256 = "1lywirv3d1lw691mc4mfpz7ak6r49klri43bbfgdnvsfppxminj2";
7007-
};
7008-
7009-
buildInputs =
7010-
[ self.funcsigs
7011-
self.six
7012-
];
7013-
7014-
meta = with pkgs.stdenv.lib; {
7015-
description = "Logfury is for python library maintainers. It allows for responsible, low-boilerplate logging of method calls.";
7016-
homepage = "https://github.com/ppolewicz/logfury";
7017-
license = licenses.bsd3;
7018-
maintainers = with maintainers; [ jwiegley ];
7019-
};
7020-
};
7001+
logfury = callPackage ../development/python-modules/logfury { };
70217002

70227003
ndg-httpsclient = buildPythonPackage rec {
70237004
version = "0.4.2";
@@ -15763,22 +15744,7 @@ in {
1576315744

1576415745
pbr = callPackage ../development/python-modules/pbr { };
1576515746

15766-
fixtures = buildPythonPackage rec {
15767-
name = "fixtures-1.4.0";
15768-
15769-
src = pkgs.fetchurl {
15770-
url = "mirror://pypi/f/fixtures/${name}.tar.gz";
15771-
sha256 = "0djxvdwm8s60dbfn7bhf40x6g818p3b3mlwijm1c3bqg7msn271y";
15772-
};
15773-
15774-
buildInputs = with self; [ pbr testtools mock ];
15775-
15776-
meta = {
15777-
description = "Reusable state for writing clean tests and more";
15778-
homepage = "https://pypi.python.org/pypi/fixtures";
15779-
license = licenses.asl20;
15780-
};
15781-
};
15747+
fixtures = callPackage ../development/python-modules/fixtures { };
1578215748

1578315749
pelican = callPackage ../development/python-modules/pelican {
1578415750
inherit (pkgs) glibcLocales pandoc git;
@@ -19282,31 +19248,7 @@ in {
1928219248
};
1928319249

1928419250

19285-
restview = buildPythonPackage rec {
19286-
name = "restview-${version}";
19287-
version = "2.5.2";
19288-
19289-
src = pkgs.fetchurl {
19290-
url = "mirror://pypi/r/restview/${name}.tar.gz";
19291-
sha256 = "0gmdmnlhiy6lagi17maiz312374hk6g6x90fhjwnbrwxif4r9bd5";
19292-
};
19293-
19294-
propagatedBuildInputs = with self; [ docutils readme pygments ];
19295-
buildInputs = with self; [ mock ];
19296-
19297-
patchPhase = ''
19298-
# dict order breaking tests
19299-
sed -i 's@<a href="http://www.example.com" rel="nofollow">@...@' src/restview/tests.py
19300-
'';
19301-
19302-
meta = {
19303-
description = "ReStructuredText viewer";
19304-
homepage = http://mg.pov.lt/restview/;
19305-
license = licenses.gpl2;
19306-
platforms = platforms.all;
19307-
maintainers = with maintainers; [ koral ];
19308-
};
19309-
};
19251+
restview = callPackage ../development/python-modules/restview { };
1931019252

1931119253
readme = buildPythonPackage rec {
1931219254
name = "readme-${version}";
@@ -19335,6 +19277,8 @@ in {
1933519277
};
1933619278
};
1933719279

19280+
readme_renderer = callPackage ../development/python-modules/readme_renderer { };
19281+
1933819282
rjsmin = callPackage ../development/python-modules/rjsmin { };
1933919283

1934019284
pysolr = buildPythonPackage rec {
@@ -19421,27 +19365,7 @@ in {
1942119365
};
1942219366
};
1942319367

19424-
django-multiselectfield = buildPythonPackage rec {
19425-
name = "django-multiselectfield-${version}";
19426-
version = "0.1.3";
19427-
19428-
src = pkgs.fetchurl {
19429-
url = "mirror://pypi/d/django-multiselectfield/django-multiselectfield-${version}.tar.gz";
19430-
sha256 = "0v7wf82f8688srdsym9ajv1j54bxfxwvydypc03f8xyl4c1raziv";
19431-
};
19432-
19433-
propagatedBuildInputs = with self; [
19434-
19435-
];
19436-
buildInputs = with self; [
19437-
19438-
];
19439-
19440-
meta = with stdenv.lib; {
19441-
description = "django-multiselectfield";
19442-
homepage = "https://github.com/goinnn/django-multiselectfield";
19443-
};
19444-
};
19368+
django-multiselectfield = callPackage ../development/python-modules/django-multiselectfield { };
1944519369

1944619370
reviewboard = buildPythonPackage rec {
1944719371
name = "ReviewBoard-2.5.1.1";

0 commit comments

Comments
 (0)
Please sign in to comment.