Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setuptools, easy_install, and a custom pypi server

I've got a custom pypi server running and am wondering how to point all references to https://pypi.python.org/ from there to my custom server?

I want to be able to cover cases of a user calling pip / easy_install of a package (so they don't have to remember to do -i or -f) as well as someone doing python setup.py install using setuptools with install_requires in the setup.py.

Is there some global config or setting I can do to get all these different methods to look at my local server? I imagine doing some network-proxy-type magic to route http://pypi.python.org/ to my custom server would be one way to go but unfortunately that's not an option.

Thanks!

like image 555
user2097446 Avatar asked Feb 21 '13 23:02

user2097446


1 Answers

The following configuration will disable the pypi repository index and make your index the only index used by pip and easy_install. The setuptools install command is basically a shortcut to run the easy_install command on the current project. So, that would work too.

# Add the following to ~/.pydistutils.cfg for easy_install
[easy_install]
index_url = http://localhost:8000/


# Add the following to ~/.pip/pip.conf for pip
[global]
index-url = http://localhost:8000/

Look at easy_install's and pip's documentation for more information.

You could provide your users with a simple python script that creates these config files for them.

like image 83
punchagan Avatar answered Oct 29 '22 07:10

punchagan