login community faq

I added a static application to create a personal package index, similar to PyPI but containing customized packages (eg, a tarball of PIL with tweaked Library pointers). Now I want that when I run pip install something, the lookup to retrieve the package is done against my personal package index first and then, only if no package has been found there, on PyPI (like an override).

I tried this and it worked (PIL 1.1.7 locally, PIL 1.1.7 on PyPI):

1
pip install --find-links http://packages.myusername.webfactional.com PIL

but reading the docs about alternate package repositories I'm not sure this command does what I want:

Like --extra-index-url, --find-links is additive by default, it does not replace or supersede the index. All package sources are checked, and the latest qualifying version for every requested package is used. If you want only your --find-links URL used as package source, you need to pair it with --no-index.

Does pip install Package 1.1, if it finds Package 1.0 on the local index and Package 1.1 on PyPI? In this case, how to force pip to install the package found on the local index? I can't use --no-index to exclude the default index because it is meant to be used as the fallback package repository.

asked Feb 29 '12 at 20:26

Guandalino's gravatar image

Guandalino
3718


You should be able to specify a version to make it use the one in your index for that package,

1
You can also request a specific version (pip install SomePackage==1.0.4)

answered Feb 29 '12 at 21:15

johns's gravatar image

johns ♦♦
340427

edited Feb 29 '12 at 21:17

The thing that worried me with your solution was that PyPI got precedence over the local package repo. I tested your suggestion and instead the first repository considered is the one given with the --find-links URL. Great.

(Mar 01 '12 at 05:06) Guandalino Guandalino's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited