commit | 48fd8772bb017c7e27758709627fc714707fa954 | [log] [tgz] |
---|---|---|
author | Allen Li <ayatane@google.com> | Wed Jan 04 12:51:15 2017 -0800 |
committer | Allen Li <ayatane@google.com> | Thu Jan 05 11:04:31 2017 -0800 |
tree | 77f346a8811cef54a9de19591bc993423f4c005c | |
parent | 50165f83f4eac72ab5d0425fd3b804880fd862b7 [diff] |
Add pylint to pip_packages BUG=chromium:571100 TEST=None Change-Id: If28ae2727181845946c9f36a34716779fb4343a6
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