diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f25b110c..1612a1ff0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,4 +1,4 @@ -# Make sure that the additional_dependencies here match requirements.txt +# Make sure that the additional_dependencies here match requirements(-opts).txt ci: autofix_prs: false @@ -28,7 +28,7 @@ repos: - --jobs=0 additional_dependencies: - - httpx~=0.25.2 + - httpx~=0.26.0 - tornado~=6.4 - APScheduler~=3.10.4 - cachetools~=5.3.2 @@ -44,7 +44,7 @@ repos: - types-pytz - types-cryptography - types-cachetools - - httpx~=0.25.2 + - httpx~=0.26.0 - tornado~=6.4 - APScheduler~=3.10.4 - cachetools~=5.3.2 @@ -83,7 +83,7 @@ repos: name: ruff files: ^(telegram|examples|tests)/.*\.py$ additional_dependencies: - - httpx~=0.25.2 + - httpx~=0.26.0 - tornado~=6.4 - APScheduler~=3.10.4 - cachetools~=5.3.2 diff --git a/README.rst b/README.rst index d58d94c5e..d2bc0229f 100644 --- a/README.rst +++ b/README.rst @@ -135,7 +135,7 @@ As these features are *optional*, the corresponding 3rd party dependencies are n Instead, they are listed as optional dependencies. This allows to avoid unnecessary dependency conflicts for users who don't need the optional features. -The only required dependency is `httpx ~= 0.25.2 `_ for +The only required dependency is `httpx ~= 0.26.0 `_ for ``telegram.request.HTTPXRequest``, the default networking backend. ``python-telegram-bot`` is most useful when used along with additional libraries. diff --git a/README_RAW.rst b/README_RAW.rst index 396a03ed1..f4e574b69 100644 --- a/README_RAW.rst +++ b/README_RAW.rst @@ -136,7 +136,7 @@ As these features are *optional*, the corresponding 3rd party dependencies are n Instead, they are listed as optional dependencies. This allows to avoid unnecessary dependency conflicts for users who don't need the optional features. -The only required dependency is `httpx ~= 0.25.2 `_ for +The only required dependency is `httpx ~= 0.26.0 `_ for ``telegram.request.HTTPXRequest``, the default networking backend. ``python-telegram-bot`` is most useful when used along with additional libraries. diff --git a/requirements.txt b/requirements.txt index 2b8938a65..5151309fe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,4 @@ # versions and only increase the lower bound if necessary # httpx has no stable release yet, so let's be cautious for now -httpx ~= 0.25.2 +httpx ~= 0.26.0 diff --git a/telegram/request/_httpxrequest.py b/telegram/request/_httpxrequest.py index f477ade8e..6b86783dd 100644 --- a/telegram/request/_httpxrequest.py +++ b/telegram/request/_httpxrequest.py @@ -167,7 +167,7 @@ class HTTPXRequest(BaseRequest): ) self._client_kwargs = { "timeout": timeout, - "proxies": proxy, + "proxy": proxy, "limits": limits, "transport": transport, **http_kwargs, diff --git a/tests/ext/test_applicationbuilder.py b/tests/ext/test_applicationbuilder.py index 1655f9457..b2a38bd91 100644 --- a/tests/ext/test_applicationbuilder.py +++ b/tests/ext/test_applicationbuilder.py @@ -120,7 +120,7 @@ class TestApplicationBuilder: @dataclass class Client: timeout: object - proxies: object + proxy: object limits: object http1: object http2: object @@ -150,7 +150,7 @@ class TestApplicationBuilder: assert get_updates_client.limits == httpx.Limits( max_connections=1, max_keepalive_connections=1 ) - assert get_updates_client.proxies is None + assert get_updates_client.proxy is None assert get_updates_client.timeout == httpx.Timeout( connect=5.0, read=5.0, write=5.0, pool=1.0 ) @@ -159,7 +159,7 @@ class TestApplicationBuilder: client = app.bot.request._client assert client.limits == httpx.Limits(max_connections=256, max_keepalive_connections=256) - assert client.proxies is None + assert client.proxy is None assert client.timeout == httpx.Timeout(connect=5.0, read=5.0, write=5.0, pool=1.0) assert client.http1 is True assert not client.http2 @@ -378,7 +378,7 @@ class TestApplicationBuilder: @dataclass class Client: timeout: object - proxies: object + proxy: object limits: object http1: object http2: object @@ -396,7 +396,7 @@ class TestApplicationBuilder: assert client.timeout == httpx.Timeout(pool=3, connect=2, read=4, write=5) assert client.limits == httpx.Limits(max_connections=1, max_keepalive_connections=1) - assert client.proxies == "proxy" + assert client.proxy == "proxy" assert client.http1 is True assert client.http2 is False @@ -414,7 +414,7 @@ class TestApplicationBuilder: assert client.timeout == httpx.Timeout(pool=3, connect=2, read=4, write=5) assert client.limits == httpx.Limits(max_connections=1, max_keepalive_connections=1) - assert client.proxies == "get_updates_proxy" + assert client.proxy == "get_updates_proxy" assert client.http1 is True assert client.http2 is False diff --git a/tests/request/test_request.py b/tests/request/test_request.py index 23143779d..51f3831e9 100644 --- a/tests/request/test_request.py +++ b/tests/request/test_request.py @@ -410,6 +410,9 @@ class TestRequestWithoutRequest: DEFAULT_NONE, ) + print("warnings") + for entry in recwarn: + print(entry.message) if media: assert len(recwarn) == 1 assert "will default to `BaseRequest.DEFAULT_NONE` instead of 20" in str( @@ -435,7 +438,7 @@ class TestHTTPXRequestWithoutRequest: @dataclass class Client: timeout: object - proxies: object + proxy: object limits: object http1: object http2: object @@ -445,7 +448,7 @@ class TestHTTPXRequestWithoutRequest: request = HTTPXRequest() assert request._client.timeout == httpx.Timeout(connect=5.0, read=5.0, write=5.0, pool=1.0) - assert request._client.proxies is None + assert request._client.proxy is None assert request._client.limits == httpx.Limits( max_connections=1, max_keepalive_connections=1 ) @@ -461,7 +464,7 @@ class TestHTTPXRequestWithoutRequest: "pool_timeout": 46, } request = HTTPXRequest(**kwargs) - assert request._client.proxies == "proxy" + assert request._client.proxy == "proxy" assert request._client.limits == httpx.Limits( max_connections=42, max_keepalive_connections=42 )