Skip to content

Commit e1ed4a5

Browse files
chore(package): lift anyio v4 restriction (#208)
1 parent 5e04fa7 commit e1ed4a5

File tree

4 files changed

+31
-24
lines changed

4 files changed

+31
-24
lines changed

pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
1313
"typing-extensions>=4.5, <5",
14-
"anyio>=3.5.0, <4",
14+
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",
1717

@@ -49,7 +49,7 @@ dev-dependencies = [
4949
"pyright==1.1.332",
5050
"mypy==1.7.1",
5151
"black==23.3.0",
52-
"respx==0.19.2",
52+
"respx==0.20.2",
5353
"pytest==7.1.1",
5454
"pytest-asyncio==0.21.1",
5555
"ruff==0.0.282",

requirements-dev.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
-e file:.
1010
annotated-types==0.6.0
11-
anyio==3.7.1
11+
anyio==4.1.0
1212
argcomplete==3.1.2
1313
attrs==23.1.0
1414
black==23.3.0
@@ -20,9 +20,9 @@ distlib==0.3.7
2020
distro==1.8.0
2121
exceptiongroup==1.1.3
2222
filelock==3.12.4
23-
h11==0.12.0
24-
httpcore==0.15.0
25-
httpx==0.23.0
23+
h11==0.14.0
24+
httpcore==1.0.2
25+
httpx==0.25.2
2626
idna==3.4
2727
iniconfig==2.0.0
2828
isort==5.10.1
@@ -41,8 +41,8 @@ pyright==1.1.332
4141
pytest==7.1.1
4242
pytest-asyncio==0.21.1
4343
python-dateutil==2.8.2
44-
respx==0.19.2
45-
rfc3986==1.5.0
44+
pytz==2023.3.post1
45+
respx==0.20.2
4646
ruff==0.0.282
4747
six==1.16.0
4848
sniffio==1.3.0

requirements.lock

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,15 @@
88

99
-e file:.
1010
annotated-types==0.6.0
11-
anyio==3.7.1
11+
anyio==4.1.0
1212
certifi==2023.7.22
1313
distro==1.8.0
1414
exceptiongroup==1.1.3
15-
h11==0.12.0
16-
httpcore==0.15.0
17-
httpx==0.23.0
15+
h11==0.14.0
16+
httpcore==1.0.2
17+
httpx==0.25.2
1818
idna==3.4
1919
pydantic==2.4.2
2020
pydantic-core==2.10.1
21-
rfc3986==1.5.0
2221
sniffio==1.3.0
2322
typing-extensions==4.8.0

tests/test_client.py

+19-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import json
77
import asyncio
88
import inspect
9-
from typing import Any, Dict, Union, cast
9+
from typing import Any, Union, cast
1010
from unittest import mock
1111

1212
import httpx
@@ -353,7 +353,7 @@ def test_request_extra_query(self) -> None:
353353
),
354354
),
355355
)
356-
params = cast(Dict[str, str], dict(request.url.params))
356+
params = dict(request.url.params)
357357
assert params == {"my_query_param": "Foo"}
358358

359359
# if both `query` and `extra_query` are given, they are merged
@@ -367,7 +367,7 @@ def test_request_extra_query(self) -> None:
367367
),
368368
),
369369
)
370-
params = cast(Dict[str, str], dict(request.url.params))
370+
params = dict(request.url.params)
371371
assert params == {"bar": "1", "foo": "2"}
372372

373373
# `extra_query` takes priority over `query` when keys clash
@@ -381,7 +381,7 @@ def test_request_extra_query(self) -> None:
381381
),
382382
),
383383
)
384-
params = cast(Dict[str, str], dict(request.url.params))
384+
params = dict(request.url.params)
385385
assert params == {"foo": "2"}
386386

387387
@pytest.mark.respx(base_url=base_url)
@@ -542,7 +542,9 @@ def test_transport_option_is_deprecated(self) -> None:
542542
DeprecationWarning,
543543
match="The `transport` argument is deprecated. The `http_client` argument should be passed instead",
544544
):
545-
transport = httpx.MockTransport(lambda: None)
545+
transport = httpx.MockTransport(
546+
lambda: None, # type: ignore
547+
)
546548

547549
client = Finch(
548550
base_url=base_url, access_token=access_token, _strict_response_validation=True, transport=transport
@@ -558,7 +560,9 @@ def test_transport_option_mutually_exclusive_with_http_client(self) -> None:
558560
base_url=base_url,
559561
access_token=access_token,
560562
_strict_response_validation=True,
561-
transport=httpx.MockTransport(lambda: None),
563+
transport=httpx.MockTransport(
564+
lambda: None, # type: ignore
565+
),
562566
http_client=http_client,
563567
)
564568

@@ -1057,7 +1061,7 @@ def test_request_extra_query(self) -> None:
10571061
),
10581062
),
10591063
)
1060-
params = cast(Dict[str, str], dict(request.url.params))
1064+
params = dict(request.url.params)
10611065
assert params == {"my_query_param": "Foo"}
10621066

10631067
# if both `query` and `extra_query` are given, they are merged
@@ -1071,7 +1075,7 @@ def test_request_extra_query(self) -> None:
10711075
),
10721076
),
10731077
)
1074-
params = cast(Dict[str, str], dict(request.url.params))
1078+
params = dict(request.url.params)
10751079
assert params == {"bar": "1", "foo": "2"}
10761080

10771081
# `extra_query` takes priority over `query` when keys clash
@@ -1085,7 +1089,7 @@ def test_request_extra_query(self) -> None:
10851089
),
10861090
),
10871091
)
1088-
params = cast(Dict[str, str], dict(request.url.params))
1092+
params = dict(request.url.params)
10891093
assert params == {"foo": "2"}
10901094

10911095
@pytest.mark.respx(base_url=base_url)
@@ -1246,7 +1250,9 @@ def test_transport_option_is_deprecated(self) -> None:
12461250
DeprecationWarning,
12471251
match="The `transport` argument is deprecated. The `http_client` argument should be passed instead",
12481252
):
1249-
transport = httpx.MockTransport(lambda: None)
1253+
transport = httpx.MockTransport(
1254+
lambda: None, # type: ignore
1255+
)
12501256

12511257
client = AsyncFinch(
12521258
base_url=base_url, access_token=access_token, _strict_response_validation=True, transport=transport
@@ -1262,7 +1268,9 @@ async def test_transport_option_mutually_exclusive_with_http_client(self) -> Non
12621268
base_url=base_url,
12631269
access_token=access_token,
12641270
_strict_response_validation=True,
1265-
transport=httpx.MockTransport(lambda: None),
1271+
transport=httpx.MockTransport(
1272+
lambda: None, # type: ignore
1273+
),
12661274
http_client=http_client,
12671275
)
12681276

0 commit comments

Comments
 (0)