EMPMYMIP seems to mostly kind of work for me. It might even do the same for you!
The implementation is kind of a huge hack, though, and it might very well
explode if pip
changes the behaviour of their bundle
command.
Create a
pypi
directory somewhere underhtdocs
:$ mkdir /var/www/pypi/
Use
pip2tgz
to download all your requirements:$ pip2tgz /var/www/pypi/ -r project/requirements.txt some-package==1.2
Use
dir2pypi
to build a pypi-compatible "simple" index:$ dir2pypi /var/www/pypi/
Prefix your
requirements.txt
with--use-index=http://example.com/pypi/simple
. From now on,pip install -r requirements.txt
will download packages from your local mirror. New packages can be added by repeating steps 2 and 3.
I've included the pip2dijkstra
and pkg2dijkstra
scripts that we use
in-house to automatically push new packages to our development server. When I
add a new requirement (or change a version of a requirement), I can run run
pip2dijkstra new-package==1.2
to pull in the new-package-1.2.tar.gz
and
publish it, all in one command (or I can use pkg2dijkstra
new-package-1.2.tar.gz
to publish a package without downloading it from
PyPI).