Bug 1437593 - Allow pip requirements to be installed from vendored packages; r=gps
☠☠ backed out by 787d7f8d7a5d ☠ ☠
authorDave Hunt <dhunt@mozilla.com>
Tue, 27 Mar 2018 13:56:44 +0100
changeset 471977 828caab5032d535314798a67eda85347ef440ab7
parent 471976 1e5514bef692f08ee0bce003f6f1c2c256cf808c
child 471978 c7fa833eff1d7818ef5ca4a5b853d03c326ec122
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1437593
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1437593 - Allow pip requirements to be installed from vendored packages; r=gps MozReview-Commit-ID: VarZNeeBYy
python/mozbuild/mozbuild/virtualenv.py
--- a/python/mozbuild/mozbuild/virtualenv.py
+++ b/python/mozbuild/mozbuild/virtualenv.py
@@ -483,17 +483,17 @@ class VirtualenvManager(object):
         args = [
             'install',
             '--use-wheel',
             package,
         ]
 
         return self._run_pip(args)
 
-    def install_pip_requirements(self, path, require_hashes=True, quiet=False):
+    def install_pip_requirements(self, path, require_hashes=True, quiet=False, vendored=False):
         """Install a pip requirements.txt file.
 
         The supplied path is a text file containing pip requirement
         specifiers.
 
         If require_hashes is True, each specifier must contain the
         expected hash of the downloaded package. See:
         https://pip.pypa.io/en/stable/reference/pip_install/#hash-checking-mode
@@ -509,16 +509,22 @@ class VirtualenvManager(object):
         ]
 
         if require_hashes:
             args.append('--require-hashes')
 
         if quiet:
             args.append('--quiet')
 
+        if vendored:
+            args.extend([
+                '--no-deps',
+                '--no-index',
+            ])
+
         return self._run_pip(args)
 
     def _run_pip(self, args):
         # It's tempting to call pip natively via pip.main(). However,
         # the current Python interpreter may not be the virtualenv python.
         # This will confuse pip and cause the package to attempt to install
         # against the executing interpreter. By creating a new process, we
         # force the virtualenv's interpreter to be used and all is well.