requests: Inconsistent urllib3 version requirements between setup.py and __init__.py
With https://github.com/requests/requests/commit/ac944b7439009ffbf7a10dfee35202f1ac090e76 the maximum allowed version of urllib3 in setup.py was increased to 1.23.
However, in https://github.com/requests/requests/blob/master/requests/__init__.py#L57-L63 the version is still required to be <= 1.22.
This is a bug since the release of requests 1.23 yesterday: https://pypi.org/project/urllib3/#history
Expected Result
Installation of requests via pip should work with urllib3 version 1.23
Actual Result
e.g.
/usr/local/lib/python2.7/dist-packages/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.23) or chardet (3.0.4) doesn't match a supported version!
RequestsDependencyWarning)
ContextualVersionConflict: urllib3 1.23
Reproduction Steps
pip install urllib3==1.23
pip install requests
import requests
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 8
- Comments: 24 (9 by maintainers)
Commits related to this issue
- Version updated to 1.0.1 and changed urllib3 dependency <= 1.22 to avoid requests issue https://github.com/requests/requests/issues/4673 — committed to dsoper2/intersight-python by deleted user 6 years ago
- Updated from generate-constraints subunit lower-constraint raised because stestr now has a minimum of 1.3.0 networkx kept at 1.11 for breakage * https://bugs.launchpad.net/openstack-requirements/+b... — committed to openstack/requirements by deleted user 6 years ago
- Updated from generate-constraints networkx kept at 1.11 for breakage * bugs.launchpad.net/openstack-requirements/+bug/1718576 google-auth and google-api-python-client kept at current for cinder bre... — committed to openstack/requirements by deleted user 6 years ago
- Update requests to solve a conflict with urllib See https://github.com/requests/requests/issues/4673 — committed to Yelp/paasta by mattmb 6 years ago
- Build wheels against constraints I was looking at wheel build failures, and in some cases builds fail because they're not constrained to versions already in the constraints. For example; pylxd faile... — committed to openstack/project-config by ianw 6 years ago
I totally understand the motivation of this design decision to generate warnings on untested
urllib3versions… but this behavior is definitely breaking in some cases (and not just a warning).Simple test case; create a distribution with an
entry_point. For example:Create a test program that resolves this entry point (we don’t even have to load it):
Then install the distribution:
This works fine. Even though we have version conflicts,
piplets us continue.But then try to ask setuptools to resolve the entry point:
TL/DR; putting an upper bound on
urllib3versions is breaking for any application that uses entry points in this way and “happens” to upgrade dependencies. That might be your intention, but this behavior definitely goes beyond “warnings” and definitely breaks some workflows (e.g. ours).Here’s how I solved it yesterday:
pip install --upgrade "urllib3==1.22" awscli awsebcliHey everyone, to be clear this isn’t a bug but rather a specific design decision. We cannot guarantee support for new releases of urllib3 before they’ve been tested with the Requests code base. In the event of a new release we haven’t tested you will see a warning message informing you about the issue.
We are currently slated to release Requests 2.19 in the next week or two which will move the warning pin. Our standard procedure is to wait a week or so and see if any major bugs are raised in urllib3’s new release. Things will continue to work fine with 1.22 in the meantime.
@jessemyers, yeah, this is the first time in almost a year, and the third time ever we’ve had a release with this process. We previously owned both the release of urllib3 and Requests so it was a bit easier to sync these things. We’ll take your suggestions into account if we review the policy with recent changes. Thanks again for clarifying your issues, it’s appreciated feedback!
Also has been experiencing this with
awsebclion my CircleCI instances since 2-3 weeks ago. Upgradingpipandrequestsbefore installingawsebclisolved the issue.Here’s what my CI script was doing before:
Here’s what it’s doing now:
Seems like this issue broke installation of
awscliAlright, 2.19.0 is out the door! Closing this out since it should be resolved now.