Skip to content

Commit 9ed006d

Browse files
committed
Support urllib3 >= 2.0.0
The urllib3.request.RequestMethods has been moved to urllib3._request_methods.RequestMethods. This patch changes the usage to continue working with the latest release, but now it's a "private" class in a "private" module, so maybe it's worth to start to think about updating this code to use the public API. https://urllib3.readthedocs.io/en/stable/changelog.html#removed
1 parent b5a3929 commit 9ed006d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

google/auth/transport/urllib3.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ class Request(transport.Request):
9595
credentials.refresh(request)
9696
9797
Args:
98-
http (urllib3.request.RequestMethods): An instance of any urllib3
99-
class that implements :class:`~urllib3.request.RequestMethods`,
98+
http (urllib3._request_methods.RequestMethods): An instance of any urllib3
99+
class that implements :class:`~urllib3._request_methods.RequestMethods`,
100100
usually :class:`urllib3.PoolManager`.
101101
102102
.. automethod:: __call__
@@ -184,7 +184,7 @@ def _make_mutual_tls_http(cert, key):
184184
return http
185185

186186

187-
class AuthorizedHttp(urllib3.request.RequestMethods):
187+
class AuthorizedHttp(urllib3._request_methods.RequestMethods):
188188
"""A urllib3 HTTP class with credentials.
189189
190190
This class is used to perform requests to API endpoints that require
@@ -197,8 +197,9 @@ class AuthorizedHttp(urllib3.request.RequestMethods):
197197
response = authed_http.request(
198198
'GET', 'https://www.googleapis.com/storage/v1/b')
199199
200-
This class implements :class:`urllib3.request.RequestMethods` and can be
201-
used just like any other :class:`urllib3.PoolManager`.
200+
This class implements
201+
:class:`urllib3._request_methods.RequestMethods` and can be used
202+
just like any other :class:`urllib3.PoolManager`.
202203
203204
The underlying :meth:`urlopen` implementation handles adding the
204205
credentials' headers to the request and refreshing credentials as needed.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# install enum34 to support 2.7. enum34 only works up to python version 3.3.
3030
'enum34>=1.1.10; python_version < "3.4"',
3131
"six>=1.9.0",
32-
"urllib3<2.0",
32+
"urllib3>=2.0",
3333
)
3434

3535
extras = {

0 commit comments

Comments
 (0)