1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 13:41:26 +00:00

python3Packages.fetchPypi: support wheels where dist & python differ

This introduces the `dist` argument to the `computeWheelUrl`, that
allows the distribution format in the path to differ from the python
version.

A wheel can be py3 and still have their file below the py2.py3 dist url.
This commit is contained in:
Martin Weinelt 2021-06-19 02:09:03 +02:00
parent 1b86310c0d
commit 136f6574a3

View file

@ -5,10 +5,10 @@
let
computeUrl = {format ? "setuptools", ... } @attrs: let
computeWheelUrl = {pname, version, python ? "py2.py3", abi ? "none", platform ? "any"}:
computeWheelUrl = {pname, version, dist ? "py2.py3", python ? "py2.py3", abi ? "none", platform ? "any"}:
# Fetch a wheel. By default we fetch an universal wheel.
# See https://www.python.org/dev/peps/pep-0427/#file-name-convention for details regarding the optional arguments.
"https://files.pythonhosted.org/packages/${python}/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-${python}-${abi}-${platform}.whl";
"https://files.pythonhosted.org/packages/${dist}/${builtins.substring 0 1 pname}/${pname}/${pname}-${version}-${python}-${abi}-${platform}.whl";
computeSourceUrl = {pname, version, extension ? "tar.gz"}:
# Fetch a source tarball.