Source

pip-patches / options-for-editable

# HG changeset patch
# Parent 7f57b700d9cc20af9182dad73a3951850aa5e823
support install/global options for editables

diff --git a/pip/req.py b/pip/req.py
--- a/pip/req.py
+++ b/pip/req.py
@@ -531,7 +531,7 @@ execfile(__file__)
 
     def install(self, install_options, global_options=()):
         if self.editable:
-            self.install_editable()
+            self.install_editable(install_options, global_options)
             return
         temp_location = tempfile.mkdtemp('-record', 'pip-')
         record_filename = os.path.join(temp_location, 'install-record.txt')
@@ -603,15 +603,17 @@ execfile(__file__)
                 rmtree(self._temp_build_dir)
             self._temp_build_dir = None
 
-    def install_editable(self):
+    def install_editable(self, install_options, global_options=()):
         logger.notify('Running setup.py develop for %s' % self.name)
         logger.indent += 2
         try:
             ## FIXME: should we do --install-headers here too?
             call_subprocess(
                 [sys.executable, '-c',
-                 "import setuptools; __file__=%r; execfile(%r)" % (self.setup_py, self.setup_py),
-                 'develop', '--no-deps'], cwd=self.source_dir, filter_stdout=self._filter_install,
+                 "import setuptools; __file__=%r; execfile(%r)" % (self.setup_py, self.setup_py)]
+                + list(global_options) + ['develop', '--no-deps'] + list(install_options),
+
+                cwd=self.source_dir, filter_stdout=self._filter_install,
                 show_stdout=False)
         finally:
             logger.indent -= 2