- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
Fix for requests 2.32 #3257
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
Fix for requests 2.32 #3257
Conversation
f579f6a    to
    b80bfbf      
    Compare
  
    | The CI failures seem to be unrelated. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
Both docker-py and requests have fixes in flight. We can narrow our pin to only exclude the breaking version. docker/docker-py#3257 psf/requests#6707 (comment)
| This will need to get updated for psf/requests#6707 (comment). Once that one is finalized I'll update the PR. | 
| I've updated it to be compatible with requests 2.32.2+, which will include psf/requests#6710. | 
        
          
                docker/transport/basehttpadapter.py
              
                Outdated
          
        
      | # https://github.com/psf/requests/commit/c0813a2d910ea6b4f8438b91d315b8d181302356 | ||
| # changes requests.adapters.HTTPAdapter to no longer call get_connection() from | ||
| # send(), but instead call _get_connection(). | ||
| def _get_connection(self, request, *args, proxies=None, **kwargs): | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll be yanking 2.32.0 and 2.32.1 once we get 2.32.2 out so this can probably be omitted from the patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed these lines. (For everyone else: now 2.32.2 is out, and 2.23.0 and 23.2.1 have been yanked.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean 2.32.0 and 2.32.1 yanked? I still got it installed as an indirect pip dependency just an hour ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caching perhaps. You can see here they are yanked: https://pypi.org/project/requests/#history.
| @felixfontein I'm away from my pc right now, but just to be clear: this would be a fix for requests versions 2.32.2 and up, correct? maybe it's also worth updating the dependency definition in pyproject.yaml to avoid accidentally using 2.32.0-2.32.1, if they would still be problematic versions | 
| If you found yourself here because you had an error such as: 
 You can probably resolve it by upgrading your   | 
Pin version of requests package until issue with Docker is fixed: docker/docker-py#3257 Change-Id: If11768d4a88c6f73622a3404ec3da3d676afb37e GitOrigin-RevId: db02ea992515352fb1e701a76db7b2a57b42cc2c
This is to fix requests 2.32.0 not being compatible with docker 6.1.3,
raising errors like:
    api-1        | 172.18.0.1 - - [24/Jul/2024:08:51:03 +0000] "POST /zeek?branch=my-testing ... HTTP/1.1" 200 100 "-" "python-requests/2.31.0"
    rq-1         |     raise InvalidURL(e, request=request)
    rq-1         | requests.exceptions.InvalidURL: Not supported URL scheme http+docker
docker/docker-py#3257 (comment)
    …g dependencies installed We ran into this issue when trying to run kilosort through docker: docker/docker-py#3256 Hopefully updating docker-py to 7.1.0 fixes it: docker/docker-py#3257 (comment)
…g dependencies installed (#59) * Update spikeinterface and docker, add workflow to test with processing dependencies installed We ran into this issue when trying to run kilosort through docker: docker/docker-py#3256 Hopefully updating docker-py to 7.1.0 fixes it: docker/docker-py#3257 (comment) * Remove numba as an explicit dependency
Pin version of requests package until issue with Docker is fixed: docker/docker-py#3257 Change-Id: I59d4882f47f4288226aaabf27554a0b7f9dfe514 GitOrigin-RevId: b46622d7a9d99dfcad2e073e5b6c07887e80542c
This allows testcontainers to work with requests >= 2.32.0. Fixes: testcontainers#717 Link: docker/docker-py#3256 Link: docker/docker-py#3257 Link: docker/docker-py#3256 (comment) Signed-off-by: Tristan Partin <[email protected]>
This allows testcontainers to work with requests >= 2.32.0. Fixes: #717 Link: docker/docker-py#3256 Link: docker/docker-py#3257 Link: docker/docker-py#3256 (comment) Signed-off-by: Tristan Partin <[email protected]>
Upgrade docker lib to work around the below regression in requests. ``` Not supported URL scheme http+docker ``` Issue: docker/docker-py#3256 Fix: docker/docker-py#3257 Signed-off-by: Chase Qi <[email protected]>
Upgrade docker lib to work around the below regression in requests. ``` Not supported URL scheme http+docker ``` Issue: docker/docker-py#3256 Fix: docker/docker-py#3257 Signed-off-by: Chase Qi <[email protected]>
The current requests 2.32.0 release breaks Docker SDK for Python (see #3256) due to psf/requests@c0813a2.
That commit makes
send()call_get_connection()instead ofget_connection(). Now the Docker SDK for Python code overwritesget_connection(), but of course doesn't magically overwrite_get_connection()as well...This PR introduces a
BaseHTTPAdapter._get_connection()method that simply callsget_connection().See for example https://github.com/docker/docker-py/blob/main/docker/transport/unixconn.py#L66.
Fixes #3256.