Bug 1240149 - Install Python packages necessary to artifact builds from mozilla pypi when running in automation. r=nalexander
MozReview-Commit-ID: 3hat64zgs2b
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -1478,21 +1478,37 @@ 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):
self._activate_virtualenv()
- 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: