git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #22345 from NixOS/python-wip

Python package updates and new fetchers

commit50bc1dc0df98b16df99ff35baf2be69e005644dc authorFrederik Rietdijk <freddyrietdijk@fridh.nl> dateThu 2 Feb 2017, 11:04 (10 years ago) parentb5a1783fae20e6
3 files changed+126−61
pkgs/development/interpreters/python/build-python-package-flit.nix+8−5 pkgs/development/interpreters/python/build-python-package.nix+2−2 pkgs/top-level/python-packages.nix+116−54
pkgs/development/interpreters/python/build-python-package-flit.nix+8−5
@@ -1,6 +1,7 @@
11# This function provides specific bits for building a flit-based Python package.
22
3−{ flit
3+{ python
4+, flit
45}:
56
67{ ... } @ attrs:
@@ -13,7 +14,9 @@ attrs // {
1314 runHook postBuild
1415 '';
1516
16− # Flit packages do not come with tests.
17− installCheckPhase = attrs.checkPhase or ":";
18− doCheck = attrs.doCheck or false;
19−}
17+ # Flit packages, like setuptools packages, might have tests.
18+ installCheckPhase = attrs.checkPhase or ''
19+ ${python.interpreter} -m unittest discover
20+ '';
21+ doCheck = attrs.doCheck or true;
22+}
pkgs/development/interpreters/python/build-python-package.nix+2−2
@@ -12,7 +12,7 @@
1212
1313let
1414 setuptools-specific = import ./build-python-package-setuptools.nix { inherit lib python bootstrapped-pip; };
15− flit-specific = import ./build-python-package-flit.nix { inherit flit; };
15+ flit-specific = import ./build-python-package-flit.nix { inherit python flit; };
1616 wheel-specific = import ./build-python-package-wheel.nix { };
1717 common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
1818in
@@ -34,4 +34,4 @@ let
3434 else if format == "other" then {}
3535 else throw "Unsupported format ${format}";
3636
37−in mkPythonDerivation ( attrs // formatspecific )
37+in mkPythonDerivation ( attrs // formatspecific )
pkgs/top-level/python-packages.nix+116−54
@@ -37,9 +37,30 @@ let
3737
3838 graphiteVersion = "0.9.15";
3939
40+ fetchwheel = {pname, version, sha256, python ? "py2.py3", abi ? "none", platform ? "any"}:
41+ # Fetch a wheel. By default we fetch an universal wheel.
42+ # See https://www.python.org/dev/peps/pep-0427/#file-name-convention for details regarding the optional arguments.
43+ let
44+ url = "https://files.pythonhosted.org/packages/${python}/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-${python}-${abi}-${platform}.whl";
45+ in pkgs.fetchurl {inherit url sha256;};
46+
47+ fetchtarball = {pname, version, sha256}:
48+ # Fetch a tarball.
49+ let
50+ url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz";
51+ in pkgs.fetchurl {inherit url sha256;};
52+
53+ fetchpypi = {format ? "setuptools", ... } @attrs:
54+ let
55+ fetcher = (if format == "wheel" then fetchwheel
56+ else if format == "setuptools" then fetchtarball
57+ else throw "Unsupported kind ${kind}");
58+ in fetcher (builtins.removeAttrs attrs ["format"]);
59+
4060in {
4161
4262 inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
63+ inherit fetchwheel fetchtarball fetchpypi;
4364
4465 # helpers
4566
@@ -4082,7 +4103,7 @@ in {
40824103 # Backported version of the ConfigParser library of Python 3.3
40834104 configparser = if isPy3k then null else buildPythonPackage rec {
40844105 name = "configparser-${version}";
4085− version = "3.3.0r2";
4106+ version = "3.5.0";
40864107
40874108 # running install_egg_info
40884109 # error: [Errno 9] Bad file descriptor: '<stdout>'
@@ -4090,9 +4111,12 @@ in {
40904111
40914112 src = pkgs.fetchurl {
40924113 url = "mirror://pypi/c/configparser/${name}.tar.gz";
4093− sha256 = "6a2318590dfc4013fc5bf53c2bec14a8cb455a232295eb282a13f94786c4b0b2";
4114+ sha256 = "5308b47021bc2340965c371f0f058cc6971a04502638d4244225c49d80db273a";
40944115 };
40954116
4117+ # No tests available
4118+ doCheck = false;
4119+
40964120 meta = {
40974121 maintainers = [ ];
40984122 platforms = platforms.all;
@@ -4386,11 +4410,11 @@ in {
43864410
43874411 cytoolz = buildPythonPackage rec {
43884412 name = "cytoolz-${version}";
4389− version = "0.8.0";
4413+ version = "0.8.2";
43904414
43914415 src = pkgs.fetchurl{
43924416 url = "mirror://pypi/c/cytoolz/cytoolz-${version}.tar.gz";
4393− sha256 = "2239890c8fe2da3eba82947c6a68cfa406e5a5045911c9ab3de8113462372629";
4417+ sha256 = "476a2ad176de5eaef80499b7b43d4f72ba6d23df33d349088dae315e9b31c552";
43944418 };
43954419
43964420 # Extension types
@@ -6602,13 +6626,14 @@ in {
66026626 });
66036627
66046628 entrypoints = buildPythonPackage rec {
6605− name = "entrypoints";
6606− version = "0.2.1";
6629+ pname = "entrypoints";
6630+ version = "0.2.2";
6631+ name = "${pname}-${version}";
66076632 format = "wheel";
66086633
6609− src = pkgs.fetchurl {
6610− url = "https://pypi.python.org/packages/a5/2d/26548d66d58f7775cb332fcf3f864987c05f5e3f800b0b22b9919dacf653/entrypoints-0.2.1-py2.py3-none-any.whl";
6611− sha256 = "112n36dllmls19j5k6bwcnsm6y2789lxzkjl1n9yir7gkm0dmzzw";
6634+ src = fetchpypi {
6635+ inherit pname version format;
6636+ sha256 = "0a0685962ee5ac303f470acbb659f0f97aef5b9deb6b85d059691c706ef6e45e";
66126637 };
66136638
66146639 propagatedBuildInputs = with self; [ configparser ];
@@ -12840,12 +12865,12 @@ in {
1284012865 };
1284112866
1284212867 ipykernel = buildPythonPackage rec {
12843− version = "4.5.1";
12868+ version = "4.5.2";
1284412869 name = "ipykernel-${version}";
1284512870
1284612871 src = pkgs.fetchurl {
1284712872 url = "mirror://pypi/i/ipykernel/${name}.tar.gz";
12848− sha256 = "520c855c6652651c6796a3dd8bc89d533023ac65c5ccf812908187d6f0e461da";
12873+ sha256 = "5a54f25f0e6c8ee74c362c23f9a95e10e74c6b7f5ef42059c861ff6f26d89462";
1284912874 };
1285012875
1285112876 buildInputs = with self; [ nose ] ++ optionals isPy27 [mock];
@@ -12870,17 +12895,17 @@ in {
1287012895 };
1287112896
1287212897 ipyparallel = buildPythonPackage rec {
12873− version = "5.2.0";
12898+ version = "6.0.0";
1287412899 name = "ipyparallel-${version}";
1287512900
1287612901 src = pkgs.fetchurl {
1287712902 url = "mirror://pypi/i/ipyparallel/${name}.tar.gz";
12878− sha256 = "d99e760f1a136b1c402755a4ab51a8d7cb87c892cccadf641948a5e886c8a455";
12903+ sha256 = "9bb5032e98a8c73ddb3da5fb8eecd93c676a5278b68799ab19257b348a0a27f6";
1287912904 };
1288012905
1288112906 buildInputs = with self; [ nose ];
1288212907
12883− propagatedBuildInputs = with self; [ipython_genutils decorator pyzmq ipython jupyter_client ipykernel tornado
12908+ propagatedBuildInputs = with self; [ dateutil ipython_genutils decorator pyzmq ipython jupyter_client ipykernel tornado
1288412909 ] ++ optionals (!isPy3k) [ futures ];
1288512910
1288612911 # Requires access to cluster
@@ -12896,12 +12921,12 @@ in {
1289612921 };
1289712922
1289812923 ipython = buildPythonPackage rec {
12899− version = "5.1.0";
12924+ version = "5.2.1";
1290012925 name = "ipython-${version}";
1290112926
1290212927 src = pkgs.fetchurl {
1290312928 url = "mirror://pypi/i/ipython/${name}.tar.gz";
12904− sha256 = "7ef4694e1345913182126b219aaa4a0047e191af414256da6772cf249571b961";
12929+ sha256 = "04dafc37c8876e10e797264302e4333dbcd2854ef6d16bb57cc12ce26515bfdb";
1290512930 };
1290612931
1290712932 prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
@@ -12964,6 +12989,9 @@ in {
1296412989 sha256 = "baf6098f054dd5eacc2934b8ea3bef908b81ca8660d839f1f940255a72c660d2";
1296512990 };
1296612991
12992+ # Tests are not distributed
12993+ doCheck = false;
12994+
1296712995 buildInputs = with self; [ nose pytest ];
1296812996 propagatedBuildInputs = with self; [ipython ipykernel traitlets notebook widgetsnbextension ];
1296912997
@@ -13172,11 +13200,13 @@ in {
1317213200 };
1317313201
1317413202 jinja2 = buildPythonPackage rec {
13175− name = "Jinja2-2.8";
13203+ pname = "Jinja2";
13204+ version = "2.9.5";
13205+ name = "${pname}-${version}";
1317613206
1317713207 src = pkgs.fetchurl {
1317813208 url = "mirror://pypi/J/Jinja2/${name}.tar.gz";
13179− sha256 = "1x0v41lp5m1pjix3l46zx02b7lqp2hflgpnxwkywxynvi3zz47xw";
13209+ sha256 = "702a24d992f856fa8d5a7a36db6128198d0c21e1da34448ca236c42e92384825";
1318013210 };
1318113211
1318213212 propagatedBuildInputs = with self; [ markupsafe ];
@@ -13288,12 +13318,12 @@ in {
1328813318 };
1328913319
1329013320 jupyter_core = buildPythonPackage rec {
13291− version = "4.2.0";
13321+ version = "4.2.1";
1329213322 name = "jupyter_core-${version}";
1329313323
1329413324 src = pkgs.fetchurl {
1329513325 url = "mirror://pypi/j/jupyter_core/${name}.tar.gz";
13296− sha256 = "44ec837a53bebf4e937112d3f9ccf31fee4f8db3e406dd0dd4f0378a354bed9c";
13326+ sha256 = "89c55399c8437f777197c2c82c1ff5639c7f71d4eb2f172a81afa120b68dc7b3";
1329713327 };
1329813328
1329913329 buildInputs = with self; [ pytest mock ];
@@ -14893,11 +14923,11 @@ in {
1489314923
1489414924 multipledispatch = buildPythonPackage rec {
1489514925 name = "multipledispatch-${version}";
14896− version = "0.4.8";
14926+ version = "0.4.9";
1489714927
1489814928 src = pkgs.fetchurl {
1489914929 url = "mirror://pypi/m/multipledispatch/${name}.tar.gz";
14900− sha256 = "07d41fb3ed25e8424536e48a8566f88a0f9926ca4b6174bff6aa16c98251b92e";
14930+ sha256 = "bda6abb8188d9abb429bd17ed15bc7433f77f1b05a78cfff761711ed81daa7a2";
1490114931 };
1490214932
1490314933 meta = {
@@ -15353,17 +15383,17 @@ in {
1535315383 };
1535415384
1535515385 nbconvert = buildPythonPackage rec {
15356− version = "4.2.0";
15386+ version = "5.1.1";
1535715387 name = "nbconvert-${version}";
1535815388
1535915389 src = pkgs.fetchurl {
1536015390 url = "mirror://pypi/n/nbconvert/${name}.tar.gz";
15361− sha256 = "1ik3k1s8dnqcc6hcrzi1wwy6f5kxfz8rnyahvpy984kl49snv52m";
15391+ sha256 = "847731bc39829d0eb1e15a450ac98c71730e3598e53683d4d76a3f3b3fc5017d";
1536215392 };
1536315393
1536415394 buildInputs = with self; [nose ipykernel ];
1536515395
15366− propagatedBuildInputs = with self; [ entrypoints mistune jinja2 pygments traitlets jupyter_core nbformat ipykernel tornado jupyter_client];
15396+ propagatedBuildInputs = with self; [ entrypoints bleach mistune jinja2 pygments traitlets testpath jupyter_core nbformat ipykernel pandocfilters tornado jupyter_client];
1536715397
1536815398 checkPhase = ''
1536915399 nosetests -v
@@ -15381,16 +15411,19 @@ in {
1538115411 };
1538215412
1538315413 nbformat = buildPythonPackage rec {
15384− version = "4.0.1";
15414+ version = "4.2.0";
1538515415 name = "nbformat-${version}";
1538615416
1538715417 src = pkgs.fetchurl {
1538815418 url = "mirror://pypi/n/nbformat/${name}.tar.gz";
15389− sha256 = "5261c957589b9dfcd387c338d59375162ba9ca82c69e378961a1f4e641285db5";
15419+ sha256 = "389a5b630a30539074f238a48fb9864592f63d611baccfa2ffaf14ffe239de06";
1539015420 };
15421+ LC_ALL="en_US.UTF-8";
15422+ buildInputs = with self; [ pytest pkgs.glibcLocales ];
15423+ propagatedBuildInputs = with self; [ipython_genutils traitlets testpath jsonschema jupyter_core];
1539115424
15392− buildInputs = with self; [ nose ];
15393− propagatedBuildInputs = with self; [ipython_genutils traitlets jsonschema jupyter_core];
15425+ # Failing tests and permission issues
15426+ doCheck = false;
1539415427
1539515428 meta = {
1539615429 description = "The Jupyter Notebook format";
@@ -15706,11 +15739,11 @@ in {
1570615739
1570715740 nose-exclude = buildPythonPackage rec {
1570815741 name = "nose-exclude-${version}";
15709− version = "0.4.1";
15742+ version = "0.5.0";
1571015743
1571115744 src = pkgs.fetchurl {
1571215745 url = "mirror://pypi/n/nose-exclude/${name}.tar.gz";
15713− sha256 = "44466a9bcb56d2e568750f91504d1278c74eabb259a305b06e975b87b51635da";
15746+ sha256 = "f78fa8b41eeb815f0486414f710f1eea0949e346cfb11d59ba6295ed69e84304";
1571415747 };
1571515748
1571615749 propagatedBuildInputs = with self; [ nose ];
@@ -15826,12 +15859,12 @@ in {
1582615859 };
1582715860
1582815861 notebook = buildPythonPackage rec {
15829− version = "4.2.3";
15862+ version = "4.3.2";
1583015863 name = "notebook-${version}";
1583115864
1583215865 src = pkgs.fetchurl {
1583315866 url = "mirror://pypi/n/notebook/${name}.tar.gz";
15834− sha256 = "39a9603d3fe88b60de2903680c965cf643acf2c16fb2c6bac1d905e1042b5851";
15867+ sha256 = "fc77edf4ec295542172aa66a3e9d527e75038fcaadd3ed20afbf8596e5629aa9";
1583515868 };
1583615869
1583715870 LC_ALL = "en_US.UTF-8";
@@ -15966,12 +15999,12 @@ in {
1596615999 numba = callPackage ../development/python-modules/numba { };
1596716000
1596816001 numexpr = buildPythonPackage rec {
15969− version = "2.6.1";
16002+ version = "2.6.2";
1597016003 name = "numexpr-${version}";
1597116004
1597216005 src = pkgs.fetchurl {
1597316006 url = "mirror://pypi/n/numexpr/${name}.tar.gz";
15974− sha256 = "db2ee72f277b23c82d204189290ea4b792f9bd5b9d67744b045f8c2a8e929a06";
16007+ sha256 = "6ab8ff5c19e7f452966bf5a3220b845cf3244fe0b96544f7f9acedcc2db5c705";
1597516008 };
1597616009
1597716010 propagatedBuildInputs = with self; [ numpy ];
@@ -17890,10 +17923,10 @@ in {
1789017923
1789117924 bottleneck = buildPythonPackage rec {
1789217925 name = "Bottleneck-${version}";
17893− version = "1.0.0";
17926+ version = "1.2.0";
1789417927 src = pkgs.fetchurl {
1789517928 url = "mirror://pypi/B/Bottleneck/Bottleneck-${version}.tar.gz";
17896− sha256 = "15dl0ll5xmfzj2fsvajzwxsb9dbw5i9fx9i4r6n4i5nzzba7m6wd";
17929+ sha256 = "3bec84564a4adbe97c24e875749b949a19cfba4e4588be495cc441db7c6b05e8";
1789717930 };
1789817931
1789917932 buildInputs = with self; [ nose ];
@@ -18411,17 +18444,19 @@ in {
1841118444
1841218445
1841318446 pexpect = buildPythonPackage rec {
18414− version = "3.3";
18447+ version = "4.2.1";
1841518448 name = "pexpect-${version}";
1841618449
1841718450 src = pkgs.fetchurl {
1841818451 url = "mirror://pypi/p/pexpect/${name}.tar.gz";
18419− sha256 = "dfea618d43e83cfff21504f18f98019ba520f330e4142e5185ef7c73527de5ba";
18452+ sha256 = "3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92";
1842018453 };
1842118454
18422− # Wants to run python in a subprocess
18455+ # Wants to run pythonin a subprocess
1842318456 doCheck = false;
1842418457
18458+ propagatedBuildInputs = with self; [ ptyprocess ];
18459+
1842518460 meta = {
1842618461 homepage = http://www.noah.org/wiki/Pexpect;
1842718462 description = "Automate interactive console applications such as ssh, ftp, etc";
@@ -21979,11 +22014,11 @@ in {
2197922014
2198022015 requests2 = buildPythonPackage rec {
2198122016 name = "requests-${version}";
21982− version = "2.11.1";
22017+ version = "2.13.0";
2198322018
2198422019 src = pkgs.fetchurl {
2198522020 url = "mirror://pypi/r/requests/${name}.tar.gz";
21986− sha256 = "5acf980358283faba0b897c73959cecf8b841205bb4b2ad3ef545f46eae1a133";
22021+ sha256 = "5722cd09762faa01276230270ff16af7acf7c5c45d623868d9ba116f15791ce8";
2198722022 };
2198822023
2198922024 nativeBuildInputs = [ self.pytest ];
@@ -25134,12 +25169,12 @@ in {
2513425169 };
2513525170
2513625171 tabulate = buildPythonPackage rec {
25137− version = "0.7.5";
25172+ version = "0.7.7";
2513825173 name = "tabulate-${version}";
2513925174
2514025175 src = pkgs.fetchurl {
2514125176 url = "mirror://pypi/t/tabulate/${name}.tar.gz";
25142− sha256 = "9071aacbd97a9a915096c1aaf0dc684ac2672904cd876db5904085d6dac9810e";
25177+ sha256 = "83a0b8e17c09f012090a50e1e97ae897300a72b35e0c86c0b53d3bd2ae86d8c6";
2514325178 };
2514425179
2514525180 buildInputs = with self; [ nose ];
@@ -25372,6 +25407,35 @@ in {
2537225407 };
2537325408 };
2537425409
25410+ testpath = buildPythonPackage rec {
25411+ pname = "testpath";
25412+ version = "0.3";
25413+ name = "${pname}-${version}";
25414+
25415+ #format = "flit";
25416+ #src = pkgs.fetchFromGitHub {
25417+ # owner = "jupyter";
25418+ # repo = pname;
25419+ # rev = "${version}";
25420+ # sha256 = "1ghzmkrsrk9xrj42pjsq5gl7v3g2v0ji0xy0xzzxp5aizd3wrvl9";
25421+ #};
25422+ #doCheck = true;
25423+ #checkPhase = ''
25424+ # ${python.interpreter} -m unittest discover
25425+ #'';
25426+ format = "wheel";
25427+ src = fetchpypi {
25428+ inherit pname version format;
25429+ sha256 = "f16b2cb3b03e1ada4fb0200b265a4446f92f3ba4b9d88ace34f51c54ab6d294e";
25430+ };
25431+
25432+ meta = {
25433+ description = "Test utilities for code working with files and commands";
25434+ license = with lib.licenses; [ mit ];
25435+ homepage = https://github.com/jupyter/testpath;
25436+ };
25437+ };
25438+
2537525439 testrepository = buildPythonPackage rec {
2537625440 name = "testrepository-${version}";
2537725441 version = "0.0.20";
@@ -26893,11 +26957,11 @@ EOF
2689326957
2689426958 xarray = buildPythonPackage rec {
2689526959 name = "xarray-${version}";
26896− version = "0.8.2";
26960+ version = "0.9.1";
2689726961
2689826962 src = pkgs.fetchurl {
2689926963 url = "mirror://pypi/x/xarray/${name}.tar.gz";
26900− sha256 = "4da06e38baea65c51347ba0770db416ebf003dbad5637215d2b25b191f2be1fb";
26964+ sha256 = "89772ed0e23f0e71c3fb8323746374999ecbe79c113e3fadc7ae6374e6dc0525";
2690126965 };
2690226966
2690326967 buildInputs = with self; [ pytest ];
@@ -30736,18 +30800,16 @@ EOF
3073630800 };
3073730801 };
3073830802 pandocfilters = buildPythonPackage rec{
30739− version = "1.3.0";
30803+ version = "1.4.1";
3074030804 pname = "pandocfilters";
3074130805 name = pname + "-${version}";
3074230806
30743− src = pkgs.fetchFromGitHub {
30744− owner = "jgm";
30745− repo = pname;
30746− rev = version;
30747− sha256 = "0ky9k800ixwiwvra0na6d6qaqcyps83mycgd8qvkrn5r80hddkzz";
30807+ src = fetchpypi{
30808+ inherit pname version;
30809+ sha256 = "ec8bcd100d081db092c57f93462b1861bcfa1286ef126f34da5cb1d969538acd";
3074830810 };
30749−
30750− propagatedBuildInputs = with self; [ ];
30811+ # No tests available
30812+ doCheck = false;
3075130813
3075230814 meta = {
3075330815 description = "A python module for writing pandoc filters, with a collection of examples";