commit | 79a4e3aa370a94d65a6115581a4d1c42b4c28374 | [log] [tgz] |
---|---|---|
author | Allen Li <ayatane@google.com> | Thu Jan 05 14:41:09 2017 -0800 |
committer | Allen Li <ayatane@google.com> | Thu Jan 05 14:41:09 2017 -0800 |
tree | 6cd7a5148c143c6556a26dada533940893d89e20 | |
parent | 43c56c0717c2e2c5cfc018dcc1215c985095c3fc [diff] |
Increase timeout for grabbing lock Allow more leeway if machine is under heavy load BUG=chromium:678677 TEST=None Change-Id: Id2bd44bea5e3e103e4fbfebd107d0b439330fbdc
This repository provides a common Python virtualenv interface that infra code (such as chromite) can depend on. At this point, it is experimental and not yet used in production.
Virtualenv users should create a requirements.txt
file listing the packages that they need and use the wrapper scripts (described below) to create the virtualenv and run commands within it.
To add packages to this repository, run:
$ pip wheel -w path/to/pip_packages -r path/to/requirements.txt
Commit the changes and make a CL.
For example for chromite, from within chromite/virtualenv
, run:
$ pip wheel -w pip_packages -r requirements.txt
create_venv
creates or updates a virtualenv using a requirements.txt
file.
$ create_venv .venv requirements.txt
To run the virtualenv python, use:
$ .venv/bin/python
NOTE: it is not generally safe to run the other scripts in .venv/bin
due to the hard-coded paths in the virtualenv. Instead of running .venv/bin/pip
for example, use .venv/bin/python -m pip
.
Here’s a complete example:
$ echo mock==2.0.0 > requirements.txt $ ./create_venv .venv requirements.txt $ .venv/bin/python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.prefix # This points to the virtualenv now '/usr/local/google/home/ayatane/src/chromiumos/infra_virtualenv/.venv' >>> import mock