diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-10-16 12:11:24 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-10-16 12:11:24 +0000 |
commit | 40811e93f3fdf9342a9295369994012420fac548 (patch) | |
tree | a8d85e094a9c21e10aa250f537c101fc2016a049 /contrib/python/httpcore | |
parent | 30ebe5357bb143648c6be4d151ecd4944af81ada (diff) | |
parent | 28a0c4a9f297064538a018c512cd9bbd00a1a35d (diff) | |
download | ydb-40811e93f3fdf9342a9295369994012420fac548.tar.gz |
Merge branch 'rightlib' into mergelibs-241016-1210
Diffstat (limited to 'contrib/python/httpcore')
-rw-r--r-- | contrib/python/httpcore/.dist-info/METADATA | 12 | ||||
-rw-r--r-- | contrib/python/httpcore/README.md | 2 | ||||
-rw-r--r-- | contrib/python/httpcore/httpcore/__init__.py | 2 | ||||
-rw-r--r-- | contrib/python/httpcore/httpcore/_async/connection_pool.py | 6 | ||||
-rw-r--r-- | contrib/python/httpcore/httpcore/_backends/anyio.py | 5 | ||||
-rw-r--r-- | contrib/python/httpcore/httpcore/_sync/connection_pool.py | 6 | ||||
-rw-r--r-- | contrib/python/httpcore/httpcore/_synchronization.py | 2 | ||||
-rw-r--r-- | contrib/python/httpcore/ya.make | 2 |
8 files changed, 22 insertions, 15 deletions
diff --git a/contrib/python/httpcore/.dist-info/METADATA b/contrib/python/httpcore/.dist-info/METADATA index 0e2009536e..6be8e4bb68 100644 --- a/contrib/python/httpcore/.dist-info/METADATA +++ b/contrib/python/httpcore/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.3 Name: httpcore -Version: 1.0.5 +Version: 1.0.6 Summary: A minimal low-level HTTP client. Project-URL: Documentation, https://www.encode.io/httpcore Project-URL: Homepage, https://www.encode.io/httpcore/ @@ -33,7 +33,7 @@ Requires-Dist: h2<5,>=3; extra == 'http2' Provides-Extra: socks Requires-Dist: socksio==1.*; extra == 'socks' Provides-Extra: trio -Requires-Dist: trio<0.26.0,>=0.22.0; extra == 'trio' +Requires-Dist: trio<1.0,>=0.22.0; extra == 'trio' Description-Content-Type: text/markdown # HTTP Core @@ -79,7 +79,7 @@ There are also a number of optional extras available... $ pip install httpcore['asyncio,trio,http2,socks'] ``` -# Sending requests +## Sending requests Send an HTTP request: @@ -153,6 +153,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## Version 1.0.6 (October 1st, 2024) + +- Relax `trio` dependency pinning. (#956) +- Handle `trio` raising `NotImplementedError` on unsupported platforms. (#955) +- Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. (#918) + ## 1.0.5 (March 27th, 2024) - Handle `EndOfStream` exception for anyio backend. (#899) diff --git a/contrib/python/httpcore/README.md b/contrib/python/httpcore/README.md index e7bfd5838f..4567ba44b4 100644 --- a/contrib/python/httpcore/README.md +++ b/contrib/python/httpcore/README.md @@ -41,7 +41,7 @@ There are also a number of optional extras available... $ pip install httpcore['asyncio,trio,http2,socks'] ``` -# Sending requests +## Sending requests Send an HTTP request: diff --git a/contrib/python/httpcore/httpcore/__init__.py b/contrib/python/httpcore/httpcore/__init__.py index 014213bae7..330745a5dc 100644 --- a/contrib/python/httpcore/httpcore/__init__.py +++ b/contrib/python/httpcore/httpcore/__init__.py @@ -130,7 +130,7 @@ __all__ = [ "WriteError", ] -__version__ = "1.0.5" +__version__ = "1.0.6" __locals = locals() diff --git a/contrib/python/httpcore/httpcore/_async/connection_pool.py b/contrib/python/httpcore/httpcore/_async/connection_pool.py index 018b0ba234..214dfc4be4 100644 --- a/contrib/python/httpcore/httpcore/_async/connection_pool.py +++ b/contrib/python/httpcore/httpcore/_async/connection_pool.py @@ -262,7 +262,7 @@ class AsyncConnectionPool(AsyncRequestInterface): queued_requests = [request for request in self._requests if request.is_queued()] for pool_request in queued_requests: origin = pool_request.request.url.origin - avilable_connections = [ + available_connections = [ connection for connection in self._connections if connection.can_handle_request(origin) and connection.is_available() @@ -277,9 +277,9 @@ class AsyncConnectionPool(AsyncRequestInterface): # 2. We can create a new connection to handle the request. # 3. We can close an idle connection and then create a new connection # to handle the request. - if avilable_connections: + if available_connections: # log: "reusing existing connection" - connection = avilable_connections[0] + connection = available_connections[0] pool_request.assign_to_connection(connection) elif len(self._connections) < self._max_connections: # log: "creating new connection" diff --git a/contrib/python/httpcore/httpcore/_backends/anyio.py b/contrib/python/httpcore/httpcore/_backends/anyio.py index 5731f5e78c..d469e0084c 100644 --- a/contrib/python/httpcore/httpcore/_backends/anyio.py +++ b/contrib/python/httpcore/httpcore/_backends/anyio.py @@ -64,6 +64,7 @@ class AnyIOStream(AsyncNetworkStream): TimeoutError: ConnectTimeout, anyio.BrokenResourceError: ConnectError, anyio.EndOfStream: ConnectError, + ssl.SSLError: ConnectError, } with map_exceptions(exc_map): try: @@ -103,9 +104,9 @@ class AnyIOBackend(AsyncNetworkBackend): timeout: typing.Optional[float] = None, local_address: typing.Optional[str] = None, socket_options: typing.Optional[typing.Iterable[SOCKET_OPTION]] = None, - ) -> AsyncNetworkStream: + ) -> AsyncNetworkStream: # pragma: nocover if socket_options is None: - socket_options = [] # pragma: no cover + socket_options = [] exc_map = { TimeoutError: ConnectTimeout, OSError: ConnectError, diff --git a/contrib/python/httpcore/httpcore/_sync/connection_pool.py b/contrib/python/httpcore/httpcore/_sync/connection_pool.py index 8dcf348cac..01bec59e88 100644 --- a/contrib/python/httpcore/httpcore/_sync/connection_pool.py +++ b/contrib/python/httpcore/httpcore/_sync/connection_pool.py @@ -262,7 +262,7 @@ class ConnectionPool(RequestInterface): queued_requests = [request for request in self._requests if request.is_queued()] for pool_request in queued_requests: origin = pool_request.request.url.origin - avilable_connections = [ + available_connections = [ connection for connection in self._connections if connection.can_handle_request(origin) and connection.is_available() @@ -277,9 +277,9 @@ class ConnectionPool(RequestInterface): # 2. We can create a new connection to handle the request. # 3. We can close an idle connection and then create a new connection # to handle the request. - if avilable_connections: + if available_connections: # log: "reusing existing connection" - connection = avilable_connections[0] + connection = available_connections[0] pool_request.assign_to_connection(connection) elif len(self._connections) < self._max_connections: # log: "creating new connection" diff --git a/contrib/python/httpcore/httpcore/_synchronization.py b/contrib/python/httpcore/httpcore/_synchronization.py index 9619a39835..50cfefe0a2 100644 --- a/contrib/python/httpcore/httpcore/_synchronization.py +++ b/contrib/python/httpcore/httpcore/_synchronization.py @@ -9,7 +9,7 @@ from ._exceptions import ExceptionMapping, PoolTimeout, map_exceptions try: import trio -except ImportError: # pragma: nocover +except (ImportError, NotImplementedError): # pragma: nocover trio = None # type: ignore try: diff --git a/contrib/python/httpcore/ya.make b/contrib/python/httpcore/ya.make index 36f416f0d6..30d63fe784 100644 --- a/contrib/python/httpcore/ya.make +++ b/contrib/python/httpcore/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(1.0.5) +VERSION(1.0.6) LICENSE(BSD-3-Clause) |