lunatechian (lunatech-ian)

one relating to, belonging to, or resembling lunatech

Faster setup of virtualenv with devpi

Setting up the virtualenv can take a significant amount of time because it pulls down packages from PyPI. I was surprised that it does not try to use the locally installed packages. One way to speed up the rebuild is to use a local caching mirror of PyPI. This can be accomplished by using devpi.

Step 1: Install devpi package

sudo pip install devpi

Step 2: Add the following lines in your /root/.pip/pip.conf file

[global]
index-url  = http://localhost:3141/root/pypi/+simple/
extra-index-url  = https://pypi.python.org/simple/

From now on, pip will first try to get the package from devpi-server running on your localhost first and if you do not have devpi-server running, will fallback to pypi.python.org .

Step 3: Start the devpi-server on your localhost: devpi-server. Try installing a few packages or build a virtualenv. The command devpi-server -start will start the server and put it in background.

TODO - figure out how to start this from init.