diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2017-09-07 19:22:06 +0200 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2017-09-07 19:22:06 +0200 |
commit | b73e3bfafd42dbc9caca2eae918ce936c9471c23 (patch) | |
tree | 1c9c086e43a285d264cd0c917a04d981b03e54c8 /pkgs/development/interpreters/python/mk-python-derivation.nix | |
parent | a26ae760e2ebacc5780ebb2906a4c3cc467747c2 (diff) |
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`.
Diffstat (limited to 'pkgs/development/interpreters/python/mk-python-derivation.nix')
-rw-r--r-- | pkgs/development/interpreters/python/mk-python-derivation.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix index bc586e0b3cee8..dae465edc0d85 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; |