Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BTrees setup.py doesn't respect user defined index-url setting, breaking pip and requirements.txt style installs #48

Closed
mzpqnxow opened this issue Nov 6, 2016 · 3 comments

Comments

@mzpqnxow
Copy link

mzpqnxow commented Nov 6, 2016

When installing BTrees, the index-url of all dependencies seem to be "forced" to pypi.python.org regardless of the index-url setting in requirements.txt or in ~/.pip.ini

This creates serious problems in environments where Artifactory is used as a "proxy" to pypi.python.org and where direct connectivity to pypi.python.org is not permitted by policy. This causes the install to hang, and then finally fail with an error saying it failed to retrieve a pypi.python.org URL.

This is easy to reproduce if you have an Artifactory server or some other non pypi.python.org PyPi repository URL configured in your ~/.pip.ini like this:

--- snip ---
[global]
index-url = http://my.local.repo/artifactory/api/pypi/pypi-repos/simple
--- snip ---

When I do pip install BTrees, the first HTTP/HTTPS request is made to grab the BTrees package from my local Artifactory server, as expected. After that, the 'persistent' package dependency is fetched since it is a dependency of BTrees- but it is not fetched from the Artifactory server as one would expect- instead, it always goes directly to pypi.python.org to try to fetch the package.

The workaround is to manually install all of the dependencies before install BTrees, so that it doesn't need to fetch any dependencies.

I would like to submit a pull request to fix the issue, but I'm not terribly familiar with setuptools or pip. Maybe this is an easy fix for someone who knows the tools better?

Thanks.

@mzpqnxow
Copy link
Author

mzpqnxow commented Nov 7, 2016

@mzpqnxow
Copy link
Author

mzpqnxow commented Nov 7, 2016

Submitted #49 for this - the conclusion everyone seems to come to is "don't use setup_requires" - and it doesn't seem to be needed here

@mzpqnxow
Copy link
Author

mzpqnxow commented Nov 7, 2016

For now, I will stick with a client-side workaround. I am using the following to get ZEO+ZEODB working via a single run with requirements.txt:

$ cat venv/.pydistutils.cfg
[easy_install]
allow_hosts = *.internal
find_links =
http://my.artifactory.internal/artifactory/api/pypi/pypi-repos/simple/zope.interface/
http://my.artifactory.internal/artifactory/api/pypi/pypi-repos/simple/persistent/

And the requirements.txt file I am using:

$ cat venv/requirements.txt
BTrees==4.3.1
ZEO==5.0.2
ZODB==5.0.0

This solves the issue. Having to have specific find_links values is a little annoying, but isn't terrible.

@mzpqnxow mzpqnxow closed this as completed Nov 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant