Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, bootstrapped-pip
4, fetchFromGitHub
5, mock
6, scripttest
7, virtualenv
8, pretend
9, pytest
10
11# coupled downsteam dependencies
12, pip-tools
13}:
14
15buildPythonPackage rec {
16 pname = "pip";
17 version = "22.2.2";
18 format = "other";
19
20 src = fetchFromGitHub {
21 owner = "pypa";
22 repo = pname;
23 rev = version;
24 sha256 = "sha256-SLjmxFUFmvgy8E8kxfc6lxxCRo+GN4L77pqkWkRR8aE=";
25 name = "${pname}-${version}-source";
26 };
27
28 nativeBuildInputs = [ bootstrapped-pip ];
29
30 postPatch = ''
31 # Remove vendored Windows PE binaries
32 # Note: These are unused but make the package unreproducible.
33 find -type f -name '*.exe' -delete
34 '';
35
36 # pip detects that we already have bootstrapped_pip "installed", so we need
37 # to force it a little.
38 pipInstallFlags = [ "--ignore-installed" ];
39
40 checkInputs = [ mock scripttest virtualenv pretend pytest ];
41 # Pip wants pytest, but tests are not distributed
42 doCheck = false;
43
44 passthru.tests = { inherit pip-tools; };
45
46 meta = {
47 description = "The PyPA recommended tool for installing Python packages";
48 license = with lib.licenses; [ mit ];
49 homepage = "https://pip.pypa.io/";
50 priority = 10;
51 };
52}