@@ -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−