Skip to content

Commit

Permalink
🔖 Release 2.1.903 (#36)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ousret authored Oct 23, 2023
1 parent 5f57cff commit 8b6d9c9
Show file tree
Hide file tree
Showing 41 changed files with 363 additions and 681 deletions.
21 changes: 21 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
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. The private module ``urllib3._base_connection`` is renamed to ``urllib3._typing``.
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.
- Avoid installation of ``qh3`` in PyPy 3.11+ while pre-built wheels are unavailable.

2.1.902 (2023-10-21)
====================

Expand Down
2 changes: 0 additions & 2 deletions docs/reference/contrib/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ prime time or that require optional third-party dependencies.

.. toctree::

pyopenssl
securetransport
socks
10 changes: 0 additions & 10 deletions docs/reference/contrib/pyopenssl.rst

This file was deleted.

31 changes: 0 additions & 31 deletions docs/reference/contrib/securetransport.rst

This file was deleted.

5 changes: 0 additions & 5 deletions docs/reference/urllib3.response.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ Response and Decoders
Response
--------

.. autoclass:: urllib3.response.BaseHTTPResponse
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: urllib3.response.HTTPResponse
:members:
:undoc-members:
Expand Down
19 changes: 0 additions & 19 deletions docs/v2-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ What are the important changes?
Here's a short summary of which changes in urllib3 v2.0 are most important:

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


Security fixes for urllib3 v1.26.x
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Thanks to support from `Tidelift <https://tidelift.com/subscription/pkg/pypi-urllib3>`_
we're able to continue supporting the v1.26.x release stream with
security fixes for the foreseeable future 💖

However, upgrading is still recommended as **no new feature developments or non-critical
bug fixes will be shipped to the 1.26.x release stream**.

If your organization relies on urllib3 and is interested in continuing support you can learn
more about the `Tidelift Subscription for Enterprise <https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=docs>`_.

**🤔 Common upgrading issues**
-------------------------------

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

We've also added API interfaces like ``BaseHTTPResponse``
and ``BaseHTTPConnection`` to ensure that when you're sub-classing
an interface you're only using supported public APIs to ensure
compatibility and minimize breakages down the road.

.. note::

If you're one of the rare few who is subclassing connections
Expand Down
3 changes: 2 additions & 1 deletion mypy-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mypy==1.4.1
mypy==1.6.1; python_version >= '3.8'
mypy==1.4.1; python_version < '3.8'
idna>=2.0.0
cryptography>=1.3.4
tornado>=6.1
Expand Down
6 changes: 2 additions & 4 deletions notes/public-and-private-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@
- `urllib3.ProxyManager`
- `urllib3.HTTPConnectionPool`
- `urllib3.HTTPSConnectionPool`
- `urllib3.BaseHTTPResponse`
- `urllib3.HTTPResponse`
- `urllib3.HTTPHeaderDict`
- `urllib3.filepost`
- `urllib3.fields`
- `urllib3.exceptions`
- `urllib3.contrib.*`
- `urllib3.contrib.socks`
- `urllib3.contrib.pyopenssl`
- `urllib3.util`

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

## Private APIs

- `urllib3.connection`
- `urllib3.connection.BaseHTTPConnection`
- `urllib3.connection.BaseHTTPSConnection`
- `urllib3.connection.HTTPConnection`
- `urllib3.connection.HTTPSConnection`
- `urllib3.util.*` (submodules)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ classifiers = [
requires-python = ">=3.7"
dynamic = ["version"]
dependencies = [
"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'))",
"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'))",
"h11>=0.11.0,<1.0.0",
"h2>=4.0.0,<5.0.0",
]
Expand Down
4 changes: 2 additions & 2 deletions src/urllib3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
from os import environ

from . import exceptions
from ._base_connection import _TYPE_BODY
from ._collections import HTTPHeaderDict
from ._typing import _TYPE_BODY, _TYPE_FIELDS
from ._version import __version__
from .backend import ConnectionInfo, HttpVersion
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
from .filepost import _TYPE_FIELDS, encode_multipart_formdata
from .filepost import encode_multipart_formdata
from .poolmanager import PoolManager, ProxyManager, proxy_from_url
from .response import BaseHTTPResponse, HTTPResponse
from .util.request import make_headers
Expand Down
184 changes: 0 additions & 184 deletions src/urllib3/_base_connection.py

This file was deleted.

9 changes: 2 additions & 7 deletions src/urllib3/_request_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,13 @@
import typing
from urllib.parse import urlencode

from ._base_connection import _TYPE_BODY
from ._collections import HTTPHeaderDict
from .filepost import _TYPE_FIELDS, encode_multipart_formdata
from ._typing import _TYPE_BODY, _TYPE_ENCODE_URL_FIELDS, _TYPE_FIELDS
from .filepost import encode_multipart_formdata
from .response import BaseHTTPResponse

__all__ = ["RequestMethods"]

_TYPE_ENCODE_URL_FIELDS = typing.Union[
typing.Sequence[typing.Tuple[str, typing.Union[str, bytes]]],
typing.Mapping[str, typing.Union[str, bytes]],
]


class RequestMethods:
"""
Expand Down
Loading

0 comments on commit 8b6d9c9

Please sign in to comment.