Skip to content

Commit 8b6d9c9

Browse files
authored
🔖 Release 2.1.903 (#36)
2.1.903 (2023-10-23) ==================== - Removed ``BaseHTTPConnection``, and ``BaseHTTPSConnection``. Rationale: The initial idea, as far as I understand it, was to create a ``HTTPSConnection`` per protocols, e.g. HTTP/2, and HTTP/3. From the point of view of ``urllib3.future`` it was taken care of in ``contrib.hface`` where the protocols state-machines are handled. We plan to always have a unified ``Connection`` class that regroup all protocols for convenience. It brings a lot of simplification, which is welcomed. - Reduced ``BaseHTTPResponse`` to a mere alias of ``HTTPResponse`` for the same reasoning as before. There is absolutely no need whatsoever in the foreseeable future to ship urllib3.future with an alternative implementation of ``HTTPResponse``. It will be removed in a future major. - Removed ``RECENT_DATE`` and linked logic as it does not make sense to (i) maintain it (ii) the certificate verification failure won't be avoided anyway, so it is a warning prior to an unavoidable error. The warning class ``SystemTimeWarning`` will be removed in a future major. - Added support for stopping sending body if the server responded early in HTTP/2, or HTTP/3. This can happen when a server says that you exhausted the size limit or if previously sent headers were rejected for example. This should save a lot of time to users in given cases. - Refactored scattered typing aliases across the sources. ``urllib3._typing`` now contain all of our definitions.
1 parent 5f57cff commit 8b6d9c9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+363
-681
lines changed

CHANGES.rst

+21
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2.1.903 (2023-10-23)
2+
====================
3+
4+
- Removed ``BaseHTTPConnection``, and ``BaseHTTPSConnection``.
5+
Rationale: The initial idea, as far as I understand it, was to create a ``HTTPSConnection`` per protocols, e.g.
6+
HTTP/2, and HTTP/3. From the point of view of ``urllib3.future`` it was taken care of in ``contrib.hface``
7+
where the protocols state-machines are handled. We plan to always have a unified ``Connection`` class that
8+
regroup all protocols for convenience. The private module ``urllib3._base_connection`` is renamed to ``urllib3._typing``.
9+
It brings a lot of simplification, which is welcomed.
10+
- Reduced ``BaseHTTPResponse`` to a mere alias of ``HTTPResponse`` for the same reasoning as before. There is absolutely
11+
no need whatsoever in the foreseeable future to ship urllib3.future with an alternative implementation of ``HTTPResponse``.
12+
It will be removed in a future major.
13+
- Removed ``RECENT_DATE`` and linked logic as it does not make sense to (i) maintain it (ii) the certificate verification
14+
failure won't be avoided anyway, so it is a warning prior to an unavoidable error. The warning class ``SystemTimeWarning``
15+
will be removed in a future major.
16+
- Added support for stopping sending body if the server responded early in HTTP/2, or HTTP/3.
17+
This can happen when a server says that you exhausted the size limit or if previously sent
18+
headers were rejected for example. This should save a lot of time to users in given cases.
19+
- Refactored scattered typing aliases across the sources. ``urllib3._typing`` now contain all of our definitions.
20+
- Avoid installation of ``qh3`` in PyPy 3.11+ while pre-built wheels are unavailable.
21+
122
2.1.902 (2023-10-21)
223
====================
324

docs/reference/contrib/index.rst

-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,4 @@ prime time or that require optional third-party dependencies.
66

77
.. toctree::
88

9-
pyopenssl
10-
securetransport
119
socks

docs/reference/contrib/pyopenssl.rst

-10
This file was deleted.

docs/reference/contrib/securetransport.rst

-31
This file was deleted.

docs/reference/urllib3.response.rst

-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ Response and Decoders
44
Response
55
--------
66

7-
.. autoclass:: urllib3.response.BaseHTTPResponse
8-
:members:
9-
:undoc-members:
10-
:show-inheritance:
11-
127
.. autoclass:: urllib3.response.HTTPResponse
138
:members:
149
:undoc-members:

docs/v2-migration-guide.rst

-19
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ What are the important changes?
4343
Here's a short summary of which changes in urllib3 v2.0 are most important:
4444

4545
- Python version must be **3.7 or later** (previously supported Python 2.7, 3.5, and 3.6).
46-
- Removed support for non-OpenSSL TLS libraries (like LibreSSL and wolfSSL).
4746
- Removed support for OpenSSL versions older than 1.1.1.
4847
- Removed support for Python implementations that aren't CPython or PyPy3 (previously supported Google App Engine, Jython).
4948
- Removed the ``urllib3.contrib.ntlmpool`` module.
@@ -167,19 +166,6 @@ It's important to know that even if you don't upgrade all of your services to 2.
167166
immediately you will `receive security fixes on the 1.26.x release stream <#security-fixes-for-urllib3-v1-26-x>` for some time.
168167

169168

170-
Security fixes for urllib3 v1.26.x
171-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172-
173-
Thanks to support from `Tidelift <https://tidelift.com/subscription/pkg/pypi-urllib3>`_
174-
we're able to continue supporting the v1.26.x release stream with
175-
security fixes for the foreseeable future 💖
176-
177-
However, upgrading is still recommended as **no new feature developments or non-critical
178-
bug fixes will be shipped to the 1.26.x release stream**.
179-
180-
If your organization relies on urllib3 and is interested in continuing support you can learn
181-
more about the `Tidelift Subscription for Enterprise <https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs>`_.
182-
183169
**🤔 Common upgrading issues**
184170
-------------------------------
185171

@@ -341,11 +327,6 @@ on code using urllib3. This also means that for IDEs
341327
that support type hints you'll receive better suggestions
342328
from auto-complete. No more confusion with ``**kwargs``!
343329

344-
We've also added API interfaces like ``BaseHTTPResponse``
345-
and ``BaseHTTPConnection`` to ensure that when you're sub-classing
346-
an interface you're only using supported public APIs to ensure
347-
compatibility and minimize breakages down the road.
348-
349330
.. note::
350331

351332
If you're one of the rare few who is subclassing connections

mypy-requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
mypy==1.4.1
1+
mypy==1.6.1; python_version >= '3.8'
2+
mypy==1.4.1; python_version < '3.8'
23
idna>=2.0.0
34
cryptography>=1.3.4
45
tornado>=6.1

notes/public-and-private-apis.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@
77
- `urllib3.ProxyManager`
88
- `urllib3.HTTPConnectionPool`
99
- `urllib3.HTTPSConnectionPool`
10-
- `urllib3.BaseHTTPResponse`
1110
- `urllib3.HTTPResponse`
1211
- `urllib3.HTTPHeaderDict`
1312
- `urllib3.filepost`
1413
- `urllib3.fields`
1514
- `urllib3.exceptions`
16-
- `urllib3.contrib.*`
15+
- `urllib3.contrib.socks`
16+
- `urllib3.contrib.pyopenssl`
1717
- `urllib3.util`
1818

1919
Only public way to configure proxies is through `ProxyManager`?
2020

2121
## Private APIs
2222

2323
- `urllib3.connection`
24-
- `urllib3.connection.BaseHTTPConnection`
25-
- `urllib3.connection.BaseHTTPSConnection`
2624
- `urllib3.connection.HTTPConnection`
2725
- `urllib3.connection.HTTPSConnection`
2826
- `urllib3.util.*` (submodules)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ classifiers = [
3737
requires-python = ">=3.7"
3838
dynamic = ["version"]
3939
dependencies = [
40-
"qh3>=0.11.3,<1.0.0; (platform_system == 'Darwin' or platform_system == 'Windows' or platform_system == 'Linux') and (platform_python_implementation == 'CPython' or (platform_python_implementation == 'PyPy' and python_version >= '3.8'))",
40+
"qh3>=0.11.3,<1.0.0; (platform_system == 'Darwin' or platform_system == 'Windows' or platform_system == 'Linux') and (platform_python_implementation == 'CPython' or (platform_python_implementation == 'PyPy' and python_version >= '3.8' and python_version < '3.11'))",
4141
"h11>=0.11.0,<1.0.0",
4242
"h2>=4.0.0,<5.0.0",
4343
]

src/urllib3/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
from os import environ
1313

1414
from . import exceptions
15-
from ._base_connection import _TYPE_BODY
1615
from ._collections import HTTPHeaderDict
16+
from ._typing import _TYPE_BODY, _TYPE_FIELDS
1717
from ._version import __version__
1818
from .backend import ConnectionInfo, HttpVersion
1919
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
20-
from .filepost import _TYPE_FIELDS, encode_multipart_formdata
20+
from .filepost import encode_multipart_formdata
2121
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
2222
from .response import BaseHTTPResponse, HTTPResponse
2323
from .util.request import make_headers

src/urllib3/_base_connection.py

-184
This file was deleted.

src/urllib3/_request_methods.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,13 @@
44
import typing
55
from urllib.parse import urlencode
66

7-
from ._base_connection import _TYPE_BODY
87
from ._collections import HTTPHeaderDict
9-
from .filepost import _TYPE_FIELDS, encode_multipart_formdata
8+
from ._typing import _TYPE_BODY, _TYPE_ENCODE_URL_FIELDS, _TYPE_FIELDS
9+
from .filepost import encode_multipart_formdata
1010
from .response import BaseHTTPResponse
1111

1212
__all__ = ["RequestMethods"]
1313

14-
_TYPE_ENCODE_URL_FIELDS = typing.Union[
15-
typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]],
16-
typing.Mapping[str, typing.Union[str, bytes]],
17-
]
18-
1914

2015
class RequestMethods:
2116
"""

0 commit comments

Comments
 (0)