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
Use proper environment markers #706
Conversation
This will intelligently install the right dependencies for a "secure" urllib3 but only if you have a recent enough version of setuptools and pip. Closes urllib3#684
Note that while this works it places some relatively new requirements on setuptools and pip. Given how widely used urllib3 is we may want to be a bit cautious there. Just a thought. Otherwise I'm +1. |
Will it explode for older versions of setuptools/pip, or just do the same ol' thing? |
For sufficiently old versions, it'll explode.
|
What's a... sufficiently old verison? :P (cc @dstufft?) |
More specifically, will it explode any moreso than what we already have with incorrect syntax? |
Yes. I think we might be able to move this to setup.cfg and get the benefits for wheels but not for |
pip < 6 and setuptools < uh, 0.7 I think. |
@dstufft what's your gut feeling about when we should merge this? And yea I'm happy to merge a setup.cfg workaround if it's safer for now. |
I think that pip and setuptools older than that won't understand the syntax and will just ignore it, so it depends on how important you think it is that |
Given that we have naggy warnings if you don't have [secure], I think it's reasonably okay if pip install urllib3[secure] doesn't succeed. Wonder if we can print somekind of message on install to indicate that state. <- might be a great idea? |
You can't really tell what version of pip you're being installed with. |
No, I mean based on the state of import availability of dependencies for [secure]. |
You probably don't want to depend on |
@dstufft informs me that modern pip blocks stdout/stderr unless install fails, so can't do that kind of trickery anymore. Opened pypa/packaging-problems#77 but not expecting it to be available in the foreseeable future. |
Looks like wheel/setuptools don't have a way of parsing a setup.cfg for extras without using pbr. |
I just updated this to use setup.cfg. It took some work to figure out the syntax for setup.cfg but it now works. This should let older pip/setuptools to do almost the right thing when installing from an |
Looks good!
How do we do that? My release script is here: https://github.com/shazow/urllib3/blob/master/release.sh#L36 |
Just checked an sdist and it is. So we're good (that means if someone uses an sdist and then uses a new enough pip, it will build a wheel for them. (The only downside with this is that people using different packages will get different results, but that's better than having a totally broken package.) |
This will intelligently install the right dependencies for a "secure"
urllib3 but only if you have a recent enough version of setuptools and
pip.
Closes #684