Python Deployment Chronicles: New features in virtualenv
Earlier this week, I wrote about how to make virtualenv install pip and setuptools from local source distributions, instead of fetching unpinned copies of them from the Internet, which it does (somewhat silently) by default. The approach relied on a somewhat buried feature of virtualenv: looking for appropriate distributions in a virtualenv_support
directory before downloading them.
In a future release of virtualenv, this will be easier, and also more apparent. I submitted patches for two new features which were accepted by virtualenv's maintainers:
- An
--extra-search-dir=/path/to/directory
command-line argument, which lets you put pip/setuptools/distribute distributions wherever you want on the filesystem. - A
--never-download
flag, which will cause virtualenv.py to fail during installation if local distributions aren't found, instead of downloading packages from the Internet; useful if you want to be alerted early and loudly if your deployments have inadvertent Internet dependencies.
These new features are documented in the source here. If you want to start using them now, you can fetch a copy of
virtualenv.py
from the "develop" branch: https://github.com/pypa/virtualenv/raw/develop/virtualenv.py