Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Bug 740147 - VirtualenvMixin default python package server option;r=aki
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Hammel committed Apr 4, 2012
1 parent f9f3275 commit 832ac5e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mozharness/base/python.py
Expand Up @@ -26,6 +26,12 @@
"dest": "virtualenv",
"help": "Specify the virtualenv executable to use"
}
],
[["--pypi-url"],
{"action": "store",
"dest": "pypi_url",
"help": "Base URL of Python Package Index (default http://pypi.python.org/simple/)"
}
]]

class VirtualenvMixin(object):
Expand Down Expand Up @@ -122,10 +128,13 @@ def create_virtualenv(self):
error_list=PythonErrorList,
halt_on_failure=True)
pip = self.query_python_path("pip")
command = [pip, "install"]
pypi_url = c.get("pypi_url")
if pypi_url:
command += ["--pypi-url", pypi_url]
for module in c.get('virtualenv_modules', []):
self.info("Installing %s into virtualenv %s" % (module, venv_path))
self.run_command([pip, "install", c.get("%s_url" % module,
module)],
self.run_command(command + [c.get("%s_url" % module, module)],
error_list=PythonErrorList,
halt_on_failure=True)
self.info("Done creating virtualenv %s." % venv_path)
Expand Down

0 comments on commit 832ac5e

Please sign in to comment.