2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, bootstrapped-pip
|
|
|
|
, fetchFromGitHub
|
|
|
|
, mock
|
|
|
|
, scripttest
|
|
|
|
, virtualenv
|
|
|
|
, pretend
|
|
|
|
, pytest
|
2022-01-23 02:10:13 +00:00
|
|
|
|
|
|
|
# coupled downsteam dependencies
|
|
|
|
, pip-tools
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pip";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "22.2.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pypa";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-09-30 11:47:45 +00:00
|
|
|
sha256 = "sha256-SLjmxFUFmvgy8E8kxfc6lxxCRo+GN4L77pqkWkRR8aE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
name = "${pname}-${version}-source";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ bootstrapped-pip ];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Remove vendored Windows PE binaries
|
|
|
|
# Note: These are unused but make the package unreproducible.
|
|
|
|
find -type f -name '*.exe' -delete
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# pip detects that we already have bootstrapped_pip "installed", so we need
|
|
|
|
# to force it a little.
|
|
|
|
pipInstallFlags = [ "--ignore-installed" ];
|
|
|
|
|
|
|
|
checkInputs = [ mock scripttest virtualenv pretend pytest ];
|
|
|
|
# Pip wants pytest, but tests are not distributed
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-01-23 02:10:13 +00:00
|
|
|
passthru.tests = { inherit pip-tools; };
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "The PyPA recommended tool for installing Python packages";
|
|
|
|
license = with lib.licenses; [ mit ];
|
|
|
|
homepage = "https://pip.pypa.io/";
|
|
|
|
priority = 10;
|
|
|
|
};
|
|
|
|
}
|