1{ lib
2, python
3, buildPythonPackage
4, bootstrapped-pip
5, fetchFromGitHub
6, mock
7, scripttest
8, virtualenv
9, pretend
10, pytest
11, setuptools
12, wheel
13}:
14
15buildPythonPackage rec {
16 pname = "pip";
17 version = "20.1.1";
18 format = "other";
19
20 src = fetchFromGitHub {
21 owner = "pypa";
22 repo = pname;
23 rev = version;
24 sha256 = "01wq01ysv0ijcrg8a4mj72zb8al15b8vw8g3ywhxq53kbsyhfxn4";
25 name = "${pname}-${version}-source";
26 };
27
28 # Remove when solved https://github.com/NixOS/nixpkgs/issues/81441
29 # Also update pkgs/development/interpreters/python/hooks/pip-install-hook.sh accordingly
30 patches = [ ./reproducible.patch ];
31
32 nativeBuildInputs = [ bootstrapped-pip ];
33
34 # pip detects that we already have bootstrapped_pip "installed", so we need
35 # to force it a little.
36 pipInstallFlags = [ "--ignore-installed" ];
37
38 checkInputs = [ mock scripttest virtualenv pretend pytest ];
39 # Pip wants pytest, but tests are not distributed
40 doCheck = false;
41
42 meta = {
43 description = "The PyPA recommended tool for installing Python packages";
44 license = with lib.licenses; [ mit ];
45 homepage = "https://pip.pypa.io/";
46 priority = 10;
47 };
48}