[Distutils] install_requires option to force pypi url or a better approach?
ziade.tarek at gmail.com
Sat Dec 19 00:37:21 CET 2009
On Fri, Dec 18, 2009 at 11:58 PM, P.J. Eby <pje at telecommunity.com> wrote:
> You would probably be better off using the find_links option in your
> setup(), to indicate additional URLs where packages can be found. e.g.
> 'http://pypi.example.com/otherpackage']. This will tell easy_install (or
> other packaging tools) to check these pages in addition to the standard
> package-index pages, when seeking out your dependencies.
I think it's pretty tedious to add a find_links entry for each
dependency, when they are all available on some PyPI servers. Since
Pip allows to configure two PyPI servers at installation time,
And if the distribution is released in some other repository some day
(let's say PyPI) and these urls are internal, this list will have to
be changed accordingly.
>From my experience, adding some find-links in a distribution's
setup.py is a bad practice in general:
for instance, if you want to change the package index in the package
installer to control where files are downloaded, find-links will
by-pass this unless you use the "allow-hosts" option.
I had trouble with this problem for example in some places where
people had a firewall : if *one* package had a find-links, the
installer was trying to look it up, even if I had a full local PyPI
So I had to use the allow-host option to avoid this. And just because
some dependency I didn't control had a find-link.
If some dependencies are not available at PyPI. the way to get them
and install them should be documented but not forced imho. And in
Aljoša's case, they are in a PyPI-like server, so it's just a matter
of configuring pip.
More information about the Distutils-SIG