views:

944

answers:

3

I am using buildout to automatically download and setup the many dependencies of my Plone installation. buildout more or less uses easy_install to download and install a bunch of Python eggs. This usually works, but it doesn't work if any of the dependencies cannot be downloaded or if I want buildout to find an internal package not appropriate for pypi. How can I set up my own local version of pypi to automatically mirror the packages I need? Will it still depend on third-party servers for packages that use pypi for their metadata but not their code?

+5  A: 

Here are instructions on how to setup your own PyPi mirror. The homepage of this project is here. There also seems to be a growing number of mirrors out there.

For instructions on how to setup your own package index, check out this blog post where one solution is explained at the end. Then you can also host your own internal packages in there. The advantage is also that the versions are fixed that way. (For a way to pin the versions directly in buildout, check out this post).

If there is only metadata on PyPI and the archive is stored somewhere else you might of course copy that over to your index as well. If you just use a PyPI mirror I assume that you still need access to these servers.

MrTopf
+3  A: 

You can also use a mirror. Put this in the "[global]" section of "~/.pip/pip.conf":

index-url = http://d.pypi.python.org/simple/

This is a recent feature as announced here.

moraes
+3  A: 

This page shows how to use the alternate mirror mentioned in @moraes post, but for easy_install, buildout and virtualenv as well as pip:

http://jacobian.org/writing/when-pypi-goes-down/

Stuart Axon