Skip to content

Commit 51a191b

Browse files
Merge branch 'master' into document-ssl-cert-file-dir
2 parents d606f54 + 767cf6b commit 51a191b

10 files changed

Lines changed: 34 additions & 30 deletions

File tree

docs/img/speakeasy.png

-1.79 MB
Loading

docs/third_party_packages.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Provides authentication classes to be used with HTTPX's [authentication paramete
2424

2525
This package adds caching functionality to HTTPX
2626

27+
### httpx-secure
28+
29+
[GitHub](https://github.com/Zaczero/httpx-secure)
30+
31+
Drop-in SSRF protection for httpx with DNS caching and custom validation support.
32+
2733
### httpx-socks
2834

2935
[GitHub](https://github.com/romis2012/httpx-socks)

httpx/_exceptions.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@ class StreamClosed(StreamError):
331331
"""
332332

333333
def __init__(self) -> None:
334-
message = (
335-
"Attempted to read or stream content, but the stream has " "been closed."
336-
)
334+
message = "Attempted to read or stream content, but the stream has been closed."
337335
super().__init__(message)
338336

339337

httpx/_urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def __repr__(self) -> str:
379379

380380
if ":" in userinfo:
381381
# Mask any password component.
382-
userinfo = f'{userinfo.split(":")[0]}:[secure]'
382+
userinfo = f"{userinfo.split(':')[0]}:[secure]"
383383

384384
authority = "".join(
385385
[

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ brotli = [
4343
cli = [
4444
"click==8.*",
4545
"pygments==2.*",
46-
"rich>=10,<14",
46+
"rich>=10,<15",
4747
]
4848
http2 = [
4949
"h2>=3,<5",

requirements.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ chardet==5.2.0
1111
# Documentation
1212
mkdocs==1.6.1
1313
mkautodoc==0.2.0
14-
mkdocs-material==9.5.47
14+
mkdocs-material==9.6.18
1515

1616
# Packaging
17-
build==1.2.2.post1
18-
twine==6.0.1
17+
build==1.3.0
18+
twine==6.1.0
1919

2020
# Tests & Linting
21-
coverage[toml]==7.6.1
22-
cryptography==44.0.1
23-
mypy==1.13.0
24-
pytest==8.3.4
25-
ruff==0.8.1
26-
trio==0.27.0
21+
coverage[toml]==7.10.6
22+
cryptography==45.0.7
23+
mypy==1.17.1
24+
pytest==8.4.1
25+
ruff==0.12.11
26+
trio==0.30.0
2727
trio-typing==0.10.0
28-
trustme==1.2.0
29-
uvicorn==0.32.1
28+
trustme==1.2.1
29+
uvicorn==0.35.0

tests/client/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ async def test_auth_property() -> None:
326326
async with httpx.AsyncClient(transport=httpx.MockTransport(app)) as client:
327327
assert client.auth is None
328328

329-
client.auth = ("user", "password123") # type: ignore
329+
client.auth = ("user", "password123")
330330
assert isinstance(client.auth, httpx.BasicAuth)
331331

332332
url = "https://example.org/"

tests/client/test_properties.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,35 @@
33

44
def test_client_base_url():
55
client = httpx.Client()
6-
client.base_url = "https://www.example.org/" # type: ignore
6+
client.base_url = "https://www.example.org/"
77
assert isinstance(client.base_url, httpx.URL)
88
assert client.base_url == "https://www.example.org/"
99

1010

1111
def test_client_base_url_without_trailing_slash():
1212
client = httpx.Client()
13-
client.base_url = "https://www.example.org/path" # type: ignore
13+
client.base_url = "https://www.example.org/path"
1414
assert isinstance(client.base_url, httpx.URL)
1515
assert client.base_url == "https://www.example.org/path/"
1616

1717

1818
def test_client_base_url_with_trailing_slash():
1919
client = httpx.Client()
20-
client.base_url = "https://www.example.org/path/" # type: ignore
20+
client.base_url = "https://www.example.org/path/"
2121
assert isinstance(client.base_url, httpx.URL)
2222
assert client.base_url == "https://www.example.org/path/"
2323

2424

2525
def test_client_headers():
2626
client = httpx.Client()
27-
client.headers = {"a": "b"} # type: ignore
27+
client.headers = {"a": "b"}
2828
assert isinstance(client.headers, httpx.Headers)
2929
assert client.headers["A"] == "b"
3030

3131

3232
def test_client_cookies():
3333
client = httpx.Client()
34-
client.cookies = {"a": "b"} # type: ignore
34+
client.cookies = {"a": "b"}
3535
assert isinstance(client.cookies, httpx.Cookies)
3636
mycookies = list(client.cookies.jar)
3737
assert len(mycookies) == 1
@@ -42,7 +42,7 @@ def test_client_timeout():
4242
expected_timeout = 12.0
4343
client = httpx.Client()
4444

45-
client.timeout = expected_timeout # type: ignore
45+
client.timeout = expected_timeout
4646

4747
assert isinstance(client.timeout, httpx.Timeout)
4848
assert client.timeout.connect == expected_timeout

tests/client/test_queryparams.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_client_queryparams_string():
1717
assert client.params["a"] == "b"
1818

1919
client = httpx.Client()
20-
client.params = "a=b" # type: ignore
20+
client.params = "a=b"
2121
assert isinstance(client.params, httpx.QueryParams)
2222
assert client.params["a"] == "b"
2323

tests/test_content.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,18 +489,18 @@ def test_response_invalid_argument():
489489
def test_ensure_ascii_false_with_french_characters():
490490
data = {"greeting": "Bonjour, ça va ?"}
491491
response = httpx.Response(200, json=data)
492-
assert (
493-
"ça va" in response.text
494-
), "ensure_ascii=False should preserve French accented characters"
492+
assert "ça va" in response.text, (
493+
"ensure_ascii=False should preserve French accented characters"
494+
)
495495
assert response.headers["Content-Type"] == "application/json"
496496

497497

498498
def test_separators_for_compact_json():
499499
data = {"clé": "valeur", "liste": [1, 2, 3]}
500500
response = httpx.Response(200, json=data)
501-
assert (
502-
response.text == '{"clé":"valeur","liste":[1,2,3]}'
503-
), "separators=(',', ':') should produce a compact representation"
501+
assert response.text == '{"clé":"valeur","liste":[1,2,3]}', (
502+
"separators=(',', ':') should produce a compact representation"
503+
)
504504
assert response.headers["Content-Type"] == "application/json"
505505

506506

0 commit comments

Comments
 (0)