git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #12879 from NixOS/python-wip

WIP: Python: update pip and wheel

commit29310fd1e8ea6c413a2c9afdf7577e454f9510c7 authorDomen Kožar <domen@dev.si> dateTue 9 Feb 2016, 04:48 (11 years ago) parent01bbd337ddd3a0
3 files changed+8−165
pkgs/development/python-modules/bootstrapped-pip/default.nix+4−10 pkgs/development/python-modules/bootstrapped-pip/pip-7.0.1-prefix.patch−151 pkgs/top-level/python-packages.nix+4−4
pkgs/development/python-modules/bootstrapped-pip/default.nix+4−10
@@ -2,8 +2,8 @@
22
33let
44 wheel_source = fetchurl {
5− url = "https://pypi.python.org/packages/py2.py3/w/wheel/wheel-0.26.0-py2.py3-none-any.whl";
6− sha256 = "1sl642ncvipqx0hzypvl5hsiqngy0sib0kq242g4mic7vnid6bn9";
5+ url = "https://pypi.python.org/packages/py2.py3/w/wheel/wheel-0.29.0-py2.py3-none-any.whl";
6+ sha256 = "ea8033fc9905804e652f75474d33410a07404c1a78dd3c949a66863bd1050ebd";
77 };
88 setuptools_source = fetchurl {
99 url = "https://pypi.python.org/packages/3.5/s/setuptools/setuptools-19.4-py2.py3-none-any.whl";
@@ -11,11 +11,11 @@ let
1111 };
1212in stdenv.mkDerivation rec {
1313 name = "python-${python.version}-bootstrapped-pip-${version}";
14− version = "7.1.2";
14+ version = "8.0.2";
1515
1616 src = fetchurl {
1717 url = "https://pypi.python.org/packages/py2.py3/p/pip/pip-${version}-py2.py3-none-any.whl";
18− sha256 = "133hx6jaspm6hd02gza66lng37l65yficc2y2x1gh16fbhxrilxr";
18+ sha256 = "249a6f3194be8c2e8cb4d4be3f6fd16a9f1e3336218caffa8e7419e3816f9988";
1919 };
2020
2121 unpackPhase = ''
@@ -27,12 +27,6 @@ in stdenv.mkDerivation rec {
2727
2828 patchPhase = ''
2929 mkdir -p $out/bin
30−
31− # patch pip to support "pip install --prefix"
32− # https://github.com/pypa/pip/pull/3252
33− pushd $out/${python.sitePackages}/
34− patch -p1 < ${./pip-7.0.1-prefix.patch}
35− popd
3630 '';
3731
3832 buildInputs = [ python makeWrapper unzip ];
pkgs/development/python-modules/bootstrapped-pip/pip-7.0.1-prefix.patchdeleted−151
@@ -1,151 +0,0 @@
1−commit e87c83d95bb91acdca92202e94488ca51a70e059
2−Author: Domen Kožar <domen@dev.si>
3−Date: Mon Nov 16 17:39:44 2015 +0100
4−
5− WIP
6−
7−diff --git a/pip/commands/install.py b/pip/commands/install.py
8−index dbcf100..05d5a08 100644
9−--- a/pip/commands/install.py
10−+++ b/pip/commands/install.py
11−@@ -139,6 +139,13 @@ class InstallCommand(RequirementCommand):
12− "directory.")
13−
14− cmd_opts.add_option(
15−+ '--prefix',
16−+ dest='prefix_path',
17−+ metavar='dir',
18−+ default=None,
19−+ help="Installation prefix where lib, bin and other top-level folders are placed")
20−+
21−+ cmd_opts.add_option(
22− "--compile",
23− action="store_true",
24− dest="compile",
25−@@ -309,6 +316,7 @@ class InstallCommand(RequirementCommand):
26− install_options,
27− global_options,
28− root=options.root_path,
29−+ prefix=options.prefix_path,
30− )
31− reqs = sorted(
32− requirement_set.successfully_installed,
33−diff --git a/pip/locations.py b/pip/locations.py
34−index 4e6f65d..43aeb1f 100644
35−--- a/pip/locations.py
36−+++ b/pip/locations.py
37−@@ -163,7 +163,7 @@ site_config_files = [
38−
39−
40− def distutils_scheme(dist_name, user=False, home=None, root=None,
41−- isolated=False):
42−+ isolated=False, prefix=None):
43− """
44− Return a distutils install scheme
45− """
46−@@ -187,6 +187,8 @@ def distutils_scheme(dist_name, user=False, home=None, root=None,
47− i.user = user or i.user
48− if user:
49− i.prefix = ""
50−+ else:
51−+ i.prefix = prefix or i.prefix
52− i.home = home or i.home
53− i.root = root or i.root
54− i.finalize_options()
55−diff --git a/pip/req/req_install.py b/pip/req/req_install.py
56−index 7c5bf8f..6f80a18 100644
57−--- a/pip/req/req_install.py
58−+++ b/pip/req/req_install.py
59−@@ -792,7 +792,7 @@ exec(compile(
60− else:
61− return True
62−
63−- def install(self, install_options, global_options=[], root=None):
64−+ def install(self, install_options, global_options=[], root=None, prefix=None):
65− if self.editable:
66− self.install_editable(install_options, global_options)
67− return
68−@@ -800,7 +800,7 @@ exec(compile(
69− version = pip.wheel.wheel_version(self.source_dir)
70− pip.wheel.check_compatibility(version, self.name)
71−
72−- self.move_wheel_files(self.source_dir, root=root)
73−+ self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
74− self.install_succeeded = True
75− return
76−
77−@@ -833,6 +833,8 @@ exec(compile(
78−
79− if root is not None:
80− install_args += ['--root', root]
81−+ if prefix is not None:
82−+ install_args += ['--prefix', prefix]
83−
84− if self.pycompile:
85− install_args += ["--compile"]
86−@@ -988,12 +990,13 @@ exec(compile(
87− def is_wheel(self):
88− return self.link and self.link.is_wheel
89−
90−- def move_wheel_files(self, wheeldir, root=None):
91−+ def move_wheel_files(self, wheeldir, root=None, prefix=None):
92− move_wheel_files(
93− self.name, self.req, wheeldir,
94− user=self.use_user_site,
95− home=self.target_dir,
96− root=root,
97−+ prefix=prefix,
98− pycompile=self.pycompile,
99− isolated=self.isolated,
100− )
101−diff --git a/pip/wheel.py b/pip/wheel.py
102−index 403f48b..14eb141 100644
103−--- a/pip/wheel.py
104−+++ b/pip/wheel.py
105−@@ -234,12 +234,12 @@ def get_entrypoints(filename):
106−
107−
108− def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None,
109−- pycompile=True, scheme=None, isolated=False):
110−+ pycompile=True, scheme=None, isolated=False, prefix=None):
111− """Install a wheel"""
112−
113− if not scheme:
114− scheme = distutils_scheme(
115−- name, user=user, home=home, root=root, isolated=isolated
116−+ name, user=user, home=home, root=root, isolated=isolated, prefix=prefix,
117− )
118−
119− if root_is_purelib(name, wheeldir):
120−diff --git a/pip/req/req_install.py b/pip/req/req_install.py
121−index 51bf4a7..e2e285e 100644
122−--- a/pip/req/req_install.py
123−+++ b/pip/req/req_install.py
124−@@ -795,7 +795,7 @@ exec(compile(
125− def install(self, install_options, global_options=[], root=None,
126− prefix=None):
127− if self.editable:
128−- self.install_editable(install_options, global_options)
129−+ self.install_editable(install_options, global_options, prefix=prefix)
130− return
131− if self.is_wheel:
132− version = pip.wheel.wheel_version(self.source_dir)
133−@@ -929,12 +929,16 @@ exec(compile(
134− rmtree(self._temp_build_dir)
135− self._temp_build_dir = None
136−
137−- def install_editable(self, install_options, global_options=()):
138−+ def install_editable(self, install_options, global_options=(), prefix=None):
139− logger.info('Running setup.py develop for %s', self.name)
140−
141− if self.isolated:
142− global_options = list(global_options) + ["--no-user-cfg"]
143−
144−+ if prefix:
145−+ prefix_param = ['--prefix={0}'.format(prefix)]
146−+ install_options = list(install_options) + prefix_param
147−+
148− with indent_log():
149− # FIXME: should we do --install-headers here too?
150− cwd = self.source_dir
151−
pkgs/top-level/python-packages.nix+4−4
@@ -14745,12 +14745,12 @@ in modules // {
1474514745 };
1474614746
1474714747 pip = buildPythonPackage rec {
14748− version = "7.1.2";
14748+ version = "8.0.2";
1474914749 name = "pip-${version}";
1475014750
1475114751 src = pkgs.fetchurl {
1475214752 url = "http://pypi.python.org/packages/source/p/pip/pip-${version}.tar.gz";
14753− sha256 = "0xx4aypfgchxdknxq7gyqghd8wb221zrzyqlbabzm32jy237j16a";
14753+ sha256 = "46f4bd0d8dfd51125a554568d646fe4200a3c2c6c36b9f2d06d2212148439521";
1475414754 };
1475514755
1475614756 buildInputs = with self; [ mock scripttest virtualenv pytest ];
@@ -21399,11 +21399,11 @@ in modules // {
2139921399
2140021400 wheel = buildPythonPackage rec {
2140121401 name = "wheel-${version}";
21402− version = "0.26.0";
21402+ version = "0.29.0";
2140321403
2140421404 src = pkgs.fetchurl {
2140521405 url = "https://pypi.python.org/packages/source/w/wheel/${name}.tar.gz";
21406− sha256 = "eaad353805c180a47545a256e6508835b65a8e830ba1093ed8162f19a50a530c";
21406+ sha256 = "1ebb8ad7e26b448e9caa4773d2357849bf80ff9e313964bcaf79cbf0201a1648";
2140721407 };
2140821408
2140921409 buildInputs = with self; [ pytest pytestcov coverage ];