From 61a04f735af6a3cdbbb6d2d234fd2dfea934fd18 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Thu, 5 Nov 2020 14:55:02 +0100 Subject: [PATCH] python3.pkgs.pip: 20.1.1 -> 20.2.4 Reproducible builds of pyproject projects using pip is resolved. Fixes https://github.com/pypa/pip/issues/7808 Fixes https://github.com/NixOS/nixpkgs/issues/81441 The more recent c409f694807e8cd16db8e2affb630073c1aadc48 caused trouble with pyproject troubles and had to be reverted anyway. https://github.com/NixOS/nixpkgs/pull/102222#issuecomment-722380794 Revert "pythonPackages.pip: make reproducible (#102222)" This reverts commit c409f694807e8cd16db8e2affb630073c1aadc48. Revert "python3Packages.pip: allow setting reproducible temporary directory via NIX_PIP_INSTALL_TMPDIR" This reverts commit aedbade43e615d7893d268632f5e7f2570fd3233. --- .../python/hooks/pip-install-hook.sh | 4 +-- .../bootstrapped-pip/default.nix | 5 ---- .../python-modules/pip/default.nix | 8 ++---- .../python-modules/pip/reproducible.patch | 25 ------------------- 4 files changed, 3 insertions(+), 39 deletions(-) delete mode 100644 pkgs/development/python-modules/pip/reproducible.patch diff --git a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh index 73d3c3cbbff..4eefe22d3f2 100644 --- a/pkgs/development/interpreters/python/hooks/pip-install-hook.sh +++ b/pkgs/development/interpreters/python/hooks/pip-install-hook.sh @@ -11,9 +11,7 @@ pipInstallPhase() { export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" pushd dist || return 1 - mkdir tmpbuild - @pythonInterpreter@ -m pip install ./*.whl --no-index --prefix="$out" --no-cache $pipInstallFlags - rm -rf tmpbuild + @pythonInterpreter@ -m pip install ./*.whl --no-index --prefix="$out" --no-cache $pipInstallFlags --build tmpbuild popd || return 1 runHook postInstall diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index 2b1a7dc8786..8bb713b7641 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -23,11 +23,6 @@ stdenv.mkDerivation rec { ]; postPatch = '' - # Apply the pip reproducible patch - pushd "${pip.src.name}" - patch -p1 < ${../pip/reproducible.patch} - popd - mkdir -p $out/bin ''; diff --git a/pkgs/development/python-modules/pip/default.nix b/pkgs/development/python-modules/pip/default.nix index 8dbf2c54a7f..9db7cdea672 100644 --- a/pkgs/development/python-modules/pip/default.nix +++ b/pkgs/development/python-modules/pip/default.nix @@ -14,21 +14,17 @@ buildPythonPackage rec { pname = "pip"; - version = "20.1.1"; + version = "20.2.4"; format = "other"; src = fetchFromGitHub { owner = "pypa"; repo = pname; rev = version; - sha256 = "01wq01ysv0ijcrg8a4mj72zb8al15b8vw8g3ywhxq53kbsyhfxn4"; + sha256 = "eMVV4ftgV71HLQsSeaOchYlfaJVgzNrwUynn3SA1/Do="; name = "${pname}-${version}-source"; }; - # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441 - # See also https://github.com/pypa/pip/issues/7808 - patches = [ ./reproducible.patch ]; - nativeBuildInputs = [ bootstrapped-pip ]; # pip detects that we already have bootstrapped_pip "installed", so we need diff --git a/pkgs/development/python-modules/pip/reproducible.patch b/pkgs/development/python-modules/pip/reproducible.patch deleted file mode 100644 index 69001f0ef27..00000000000 --- a/pkgs/development/python-modules/pip/reproducible.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/src/pip/_internal/utils/temp_dir.py b/src/pip/_internal/utils/temp_dir.py -index 201ba6d98..f1569fecd 100644 ---- a/src/pip/_internal/utils/temp_dir.py -+++ b/src/pip/_internal/utils/temp_dir.py -@@ -3,6 +3,7 @@ from __future__ import absolute_import - import errno - import itertools - import logging -+import os - import os.path - import tempfile - from contextlib import contextmanager -@@ -181,6 +182,11 @@ class TempDirectory(object): - # symlinked to another directory. This tends to confuse build - # scripts, so we canonicalize the path by traversing potential - # symlinks here. -+ if "SOURCE_DATE_EPOCH" in os.environ: -+ path = os.path.join(tempfile.gettempdir(), "pip-{}-immobile".format(kind)) -+ os.mkdir(path) -+ return path -+ - path = os.path.realpath( - tempfile.mkdtemp(prefix="pip-{}-".format(kind)) - ) -