git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages: rename fetchers

- fetchpypi -> fetchPypi - fetchWheel and fetchTarball are no longer public https://github.com/NixOS/nixpkgs/commit/695ff0dc09b304f2e0575081c52189893c2f38bc#commitcomment-20711584

commitc1e29e237b9d25ef3826053749890fe949fcc59a authorFrederik Rietdijk <fridh@fridh.nl> dateThu 2 Feb 2017, 11:49 (10 years ago) parent1a5cdaf
1 file changed+19−20
pkgs/top-level/python-packages.nix+19−20
pkgs/top-level/python-packages.nix+19−20
@@ -37,30 +37,29 @@ 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.
40+ fetchPypi = {format ? "setuptools", ... } @attrs:
4341 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
42+ fetchWheel = {pname, version, sha256, python ? "py2.py3", abi ? "none", platform ? "any"}:
43+ # Fetch a wheel. By default we fetch an universal wheel.
44+ # See https://www.python.org/dev/peps/pep-0427/#file-name-convention for details regarding the optional arguments.
45+ let
46+ url = "https://files.pythonhosted.org/packages/${python}/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-${python}-${abi}-${platform}.whl";
47+ in pkgs.fetchurl {inherit url sha256;};
48+
49+ fetchSource = {pname, version, sha256}:
50+ # Fetch a source tarball.
51+ let
52+ url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}.tar.gz";
53+ in pkgs.fetchurl {inherit url sha256;};
54+ fetcher = (if format == "wheel" then fetchWheel
55+ else if format == "setuptools" then fetchSource
5756 else throw "Unsupported kind ${kind}");
5857 in fetcher (builtins.removeAttrs attrs ["format"]);
5958
6059in {
6160
6261 inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
63− inherit fetchwheel fetchtarball fetchpypi;
62+ inherit fetchPypi;
6463
6564 # helpers
6665
@@ -6631,7 +6630,7 @@ in {
66316630 name = "${pname}-${version}";
66326631 format = "wheel";
66336632
6634− src = fetchpypi {
6633+ src = fetchPypi {
66356634 inherit pname version format;
66366635 sha256 = "0a0685962ee5ac303f470acbb659f0f97aef5b9deb6b85d059691c706ef6e45e";
66376636 };
@@ -25424,7 +25423,7 @@ in {
2542425423 # ${python.interpreter} -m unittest discover
2542525424 #'';
2542625425 format = "wheel";
25427− src = fetchpypi {
25426+ src = fetchPypi {
2542825427 inherit pname version format;
2542925428 sha256 = "f16b2cb3b03e1ada4fb0200b265a4446f92f3ba4b9d88ace34f51c54ab6d294e";
2543025429 };
@@ -30804,7 +30803,7 @@ EOF
3080430803 pname = "pandocfilters";
3080530804 name = pname + "-${version}";
3080630805
30807− src = fetchpypi{
30806+ src = fetchPypi{
3080830807 inherit pname version;
3080930808 sha256 = "ec8bcd100d081db092c57f93462b1861bcfa1286ef126f34da5cb1d969538acd";
3081030809 };