about summary refs log tree commit diff
path: root/pkgs/development/interpreters/python
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2017-09-07 19:22:06 +0200
committerFrederik Rietdijk <fridh@fridh.nl>2017-09-07 19:22:06 +0200
commitb73e3bfafd42dbc9caca2eae918ce936c9471c23 (patch)
tree1c9c086e43a285d264cd0c917a04d981b03e54c8 /pkgs/development/interpreters/python
parenta26ae760e2ebacc5780ebb2906a4c3cc467747c2 (diff)
downloadnixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar.gz
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar.bz2
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar.lz
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar.xz
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.tar.zst
nixlib-b73e3bfafd42dbc9caca2eae918ce936c9471c23.zip
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')
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix4
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 bc586e0b3cee..dae465edc0d8 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;