Bug 1240149 - Install Python packages necessary to artifact builds from mozilla pypi when running in automation. r=nalexander
authorChris Manchester <cmanchester@mozilla.com>
Wed, 09 Mar 2016 10:58:49 -0800
changeset 287521 00de67af498e257e82c3c9b795c4d89087c10cda
parent 287520 079e85fe0e4d6271bd38ea6966950afd1b425b4c
child 287522 f271e67bc7f42c2684ac0406dc7c8ddcb8b09bb1
push id73208
push usercmanchester@mozilla.com
push dateWed, 09 Mar 2016 18:58:54 +0000
treeherdermozilla-inbound@65f081666446 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1240149
milestone48.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 1240149 - Install Python packages necessary to artifact builds from mozilla pypi when running in automation. r=nalexander MozReview-Commit-ID: 3hat64zgs2b
python/mozbuild/mozbuild/mach_commands.py
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1453,26 +1453,42 @@ class PackageFrontend(MachCommandBase):
         Never build libxul again!
 
         '''
         pass
 
     def _set_log_level(self, verbose):
         self.log_manager.terminal_handler.setLevel(logging.INFO if not verbose else logging.DEBUG)
 
+    def _install_pip_package(self, package):
+        if os.environ.get('MOZ_AUTOMATION'):
+            self.virtualenv_manager._run_pip([
+                'install',
+                package,
+                '--no-index',
+                '--find-links',
+                'http://pypi.pub.build.mozilla.org/pub',
+                '--trusted-host',
+                'pypi.pub.build.mozilla.org',
+            ])
+            return
+        self.virtualenv_manager.install_pip_package(package)
+
     def _make_artifacts(self, tree=None, job=None, skip_cache=False):
         # Undo PATH munging that will be done by activating the virtualenv,
         # so that invoked subprocesses expecting to find system python
         # (git cinnabar, in particular), will not find virtualenv python.
         original_path = os.environ.get('PATH', '')
         self._activate_virtualenv()
         os.environ['PATH'] = original_path
-        self.virtualenv_manager.install_pip_package('pylru==1.0.9')
-        self.virtualenv_manager.install_pip_package('taskcluster==0.0.32')
-        self.virtualenv_manager.install_pip_package('mozregression==1.0.2')
+
+        for package in ('pylru==1.0.9',
+                        'taskcluster==0.0.32',
+                        'mozregression==1.0.2'):
+            self._install_pip_package(package)
 
         state_dir = self._mach_context.state_dir
         cache_dir = os.path.join(state_dir, 'package-frontend')
 
         try:
             os.makedirs(cache_dir)
         except OSError as e:
             if e.errno != errno.EEXIST: