Bug 1453658: Use pip options when install python3 modules; r=bhearsum
authorTom Prince <mozilla@hocat.ca>
Thu, 12 Apr 2018 10:17:50 -0600
changeset 412939 ad1e2f797d20e85aa5d769cb45d931091b837fda
parent 412938 88e916621af96a5c6ff960c438b5b63c48db854b
child 412940 16b880957aa7bdfb5bf66bab90cb9e35d5ebe558
push id33826
push usermozilla@hocat.ca
push dateThu, 12 Apr 2018 18:45:04 +0000
treeherdermozilla-central@16b880957aa7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhearsum
bugs1453658
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 1453658: Use pip options when install python3 modules; r=bhearsum Differential Revision: https://phabricator.services.mozilla.com/D924
testing/mozharness/mozharness/base/python.py
--- a/testing/mozharness/mozharness/base/python.py
+++ b/testing/mozharness/mozharness/base/python.py
@@ -775,22 +775,27 @@ class Python3Virtualenv(object):
             self.info('Running command...')
             self.run_command(
                 '%s -m venv %s' % (self.py3_python_path, self.py3_venv_path),
                 error_list=VirtualenvErrorList,
                 halt_on_failure=True,
                 env=self.query_env())
 
     @py3_venv_initialized
-    def py3_install_modules(self, modules):
+    def py3_install_modules(self, modules,
+                            use_mozharness_pip_config=True):
         if not os.path.exists(self.py3_venv_path):
             raise Exception('You need to call py3_create_venv() first.')
 
         for m in modules:
-            self.run_command('%s install %s' % (self.py3_pip_path, m), env=self.query_env())
+            cmd = [self.py3_pip_path, 'install']
+            if use_mozharness_pip_config:
+                cmd += self._mozharness_pip_args()
+            cmd += [m]
+            self.run_command(cmd, env=self.query_env())
 
     def _mozharness_pip_args(self):
         '''We have information in Mozharness configs that apply to pip'''
         c = self.config
         pip_args = []
         # To avoid timeouts with our pypi server, increase default timeout:
         # https://bugzilla.mozilla.org/show_bug.cgi?id=1007230#c802
         pip_args += ['--timeout', str(c.get('pip_timeout', 120))]