Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: pip: 20.2.4 -> 20.3 #105540

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pipInstallPhase() {
export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH"

pushd dist || return 1
@pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags --build tmpbuild
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --build argument has been deprecated in pip 20.3. See: pypa/pip#9049

@pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags
popd || return 1

runHook postInstall
Expand Down
24 changes: 10 additions & 14 deletions pkgs/development/python-modules/bootstrapped-pip/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
{ stdenv, python, fetchPypi, makeWrapper, unzip, makeSetupHook
{ stdenv
, python
, makeWrapper
, unzip
, pipInstallHook
, setuptoolsBuildHook
, wheel, pip, setuptools
, isPy27
, wheel
, pip
, setuptools
}:

stdenv.mkDerivation rec {
Expand All @@ -23,14 +27,6 @@ stdenv.mkDerivation rec {
(setuptoolsBuildHook.override{setuptools=null; wheel=null;})
];

postPatch = ''
mkdir -p $out/bin
'' + stdenv.lib.optionalString isPy27 ''
pushd "${pip.src.name}"
patch -p1 < ${builtins.elemAt pip.patches 0}
popd
'';

nativeBuildInputs = [ makeWrapper unzip ];
buildInputs = [ python ];

Expand All @@ -49,17 +45,17 @@ stdenv.mkDerivation rec {

echo "Building setuptools wheel..."
pushd setuptools
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache --build tmpbuild .
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd

echo "Building wheel wheel..."
pushd wheel
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache --build tmpbuild .
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd

echo "Building pip wheel..."
pushd pip
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache --build tmpbuild .
${python.pythonForBuild.interpreter} -m pip install --no-build-isolation --no-index --prefix=$out --ignore-installed --no-dependencies --no-cache .
popd
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/python-modules/cypari2/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ buildPythonPackage rec {
export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"

# install "." instead of "*.whl"
${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install --no-index --prefix=$out --no-cache --build=tmpdir .
${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install --no-index --prefix=$out --no-cache
'';

nativeBuildInputs = [
Expand Down
25 changes: 5 additions & 20 deletions pkgs/development/python-modules/pip/default.nix
Original file line number Diff line number Diff line change
@@ -1,41 +1,26 @@
{ lib
, python
, buildPythonPackage
, bootstrapped-pip
, fetchFromGitHub
, fetchPypi
, mock
, scripttest
, virtualenv
, pretend
, pytest
, setuptools
, wheel
, isPy27
, fetchpatch
}:

buildPythonPackage rec {
pname = "pip";
version = "20.2.4";
version = "20.3";
format = "other";

src = fetchFromGitHub {
owner = "pypa";
repo = pname;
rev = version;
sha256 = "eMVV4ftgV71HLQsSeaOchYlfaJVgzNrwUynn3SA1/Do=";
name = "${pname}-${version}-source";
src = fetchPypi {
inherit pname version;
sha256 = "03kfx8ymqllv5lyngnylqks6h3z04ky29l29kcm2vhpaarkcmrws";
};

nativeBuildInputs = [ bootstrapped-pip ];

patches = lib.optionals isPy27 [
(fetchpatch {
url = "https://github.com/pypa/pip/commit/94fbb6cf78c267bf7cdf83eeeb2536ad56cfe639.patch";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch made it with the 20.3 release:
pypa/pip#8666

sha256 = "Z6x5yxBp8QkU/GOfb1ltI0dVt//MaI09XK3cdY42kFs=";
})
];

# pip detects that we already have bootstrapped_pip "installed", so we need
# to force it a little.
pipInstallFlags = [ "--ignore-installed" ];
Expand Down