From 15e21e9ea3cad4f06e22a7e704aabefdf43d2e29 Mon Sep 17 00:00:00 2001 From: Daniel Arvelini Date: Fri, 29 Nov 2024 08:15:56 -0300 Subject: [PATCH 1/5] Updating deprecated docstring Client() class (#3426) --- httpx/_client.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/httpx/_client.py b/httpx/_client.py index 018d440c17..2249231f8c 100644 --- a/httpx/_client.py +++ b/httpx/_client.py @@ -620,8 +620,6 @@ class Client(BaseClient): * **http2** - *(optional)* A boolean indicating if HTTP/2 support should be enabled. Defaults to `False`. * **proxy** - *(optional)* A proxy URL where all the traffic should be routed. - * **proxies** - *(optional)* A dictionary mapping proxy keys to proxy - URLs. * **timeout** - *(optional)* The timeout configuration to use when sending requests. * **limits** - *(optional)* The limits configuration to use. From 0cb7e5a2e736628e2f506d259fcf0d48cd2bde82 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:37:45 +0100 Subject: [PATCH 2/5] Bump the python-packages group with 11 updates (#3434) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marcelo Trylesinski --- requirements.txt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index 53fd0a6c25..0d8ba2eff0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,19 +11,20 @@ chardet==5.2.0 # Documentation mkdocs==1.6.1 mkautodoc==0.2.0 -mkdocs-material==9.5.39 +mkdocs-material==9.5.47 # Packaging -build==1.2.2 -twine==5.1.1 +build==1.2.2.post1 +twine==6.0.1 # Tests & Linting coverage[toml]==7.6.1 -cryptography==43.0.1 -mypy==1.11.2 -pytest==8.3.3 -ruff==0.6.8 -trio==0.26.2 +cryptography==44.0.0 +mypy==1.13.0 +pytest==8.3.4 +ruff==0.8.1 +trio==0.27.0 trio-typing==0.10.0 -trustme==1.1.0 -uvicorn==0.31.0 +trustme==1.1.0; python_version < '3.9' +trustme==1.2.0; python_version >= '3.9' +uvicorn==0.32.1 From 8ecb86f0d74ffc52d4663214fae9526bee89358d Mon Sep 17 00:00:00 2001 From: Elaina Date: Wed, 4 Dec 2024 00:12:27 +0800 Subject: [PATCH 3/5] Add test for request params behavior changes (#3364) (#3440) Co-authored-by: Tom Christie --- CHANGELOG.md | 1 + tests/models/test_requests.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc3fa411f8..060013b0f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ Our revised [SSL documentation](docs/advanced/ssl.md) covers how to implement th * Ensure `certifi` and `httpcore` are only imported if required. (#3377) * Treat `socks5h` as a valid proxy scheme. (#3178) * Cleanup `Request()` method signature in line with `client.request()` and `httpx.request()`. (#3378) +* Bugfix: When passing `params={}`, always strictly update rather than merge with an existing querystring. (#3364) ## 0.27.2 (27th August, 2024) diff --git a/tests/models/test_requests.py b/tests/models/test_requests.py index d2a458d57e..b31fe007be 100644 --- a/tests/models/test_requests.py +++ b/tests/models/test_requests.py @@ -226,3 +226,16 @@ def content() -> typing.Iterator[bytes]: request.read() pickle_request = pickle.loads(pickle.dumps(request)) assert pickle_request.content == b"test 123" + + +def test_request_params(): + request = httpx.Request("GET", "http://example.com", params={}) + assert str(request.url) == "http://example.com" + + request = httpx.Request( + "GET", "http://example.com?c=3", params={"a": "1", "b": "2"} + ) + assert str(request.url) == "http://example.com?a=1&b=2" + + request = httpx.Request("GET", "http://example.com?a=1", params={}) + assert str(request.url) == "http://example.com" From 89599a9541af14bcf906fc4ed58ccbdf403802ba Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 4 Dec 2024 11:29:09 +0000 Subject: [PATCH 4/5] Fix `verify=False`, `cert=...` case. (#3442) --- CHANGELOG.md | 4 ++++ httpx/_config.py | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 060013b0f3..4f1233ef8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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/). +## Dev + +* Fix SSL case where `verify=False` together with client side certificates. + ## 0.28.0 (28th November, 2024) The 0.28 release includes a limited set of deprecations. diff --git a/httpx/_config.py b/httpx/_config.py index dbd2b46cd1..467a6c90ae 100644 --- a/httpx/_config.py +++ b/httpx/_config.py @@ -39,10 +39,9 @@ def create_ssl_context( # Default case... ctx = ssl.create_default_context(cafile=certifi.where()) elif verify is False: - ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) - ssl_context.check_hostname = False - ssl_context.verify_mode = ssl.CERT_NONE - return ssl_context + ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) + ctx.check_hostname = False + ctx.verify_mode = ssl.CERT_NONE elif isinstance(verify, str): # pragma: nocover message = ( "`verify=` is deprecated. " From 26d48e0634e6ee9cdc0533996db289ce4b430177 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 6 Dec 2024 15:35:41 +0000 Subject: [PATCH 5/5] Version 0.28.1 (#3445) --- CHANGELOG.md | 2 +- httpx/__version__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1233ef8b..f4cd341b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ 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/). -## Dev +## 0.28.1 (6th December, 2024) * Fix SSL case where `verify=False` together with client side certificates. diff --git a/httpx/__version__.py b/httpx/__version__.py index 0a684ac3a9..801bfacf67 100644 --- a/httpx/__version__.py +++ b/httpx/__version__.py @@ -1,3 +1,3 @@ __title__ = "httpx" __description__ = "A next generation HTTP client, for Python 3." -__version__ = "0.28.0" +__version__ = "0.28.1"