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";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "22.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pypa";
|
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-mrfd3VWqb4SgSjBJAxBhYegABdJa7pVXL7wA5uZtF/A=";
|
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" ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ mock scripttest virtualenv pretend pytest ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# 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;
|
|
|
|
};
|
|
|
|
}
|