Skip to content

Commit dedfe1b

Browse files
authored
Merge branch 'johtso:master' into master
2 parents ffce92d + 7b1f266 commit dedfe1b

File tree

9 files changed

+25
-16
lines changed

9 files changed

+25
-16
lines changed

.github/workflows/test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
python-version: ["3.7", "3.8", "3.9", "3.10"]
17+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
1818

1919
steps:
2020
- uses: "actions/checkout@v2"

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

7+
## 0.1a4 (17th May, 2024)
8+
9+
Remove httpx version cap
10+
Stop testing on Python 3.7
11+
12+
## 0.1a3 (23rd August, 2023)
13+
14+
Bump httpx version to 0.23.
15+
716
## 0.1a2 (18th February, 2022)
817

918
Replace print statements with logging.

httpx_caching/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
__title__ = "httpx-caching"
22
__description__ = "Caching for HTTPX."
3-
__version__ = "0.1a2"
3+
__version__ = "0.1a4"

httpx_caching/_async/_transport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class AsyncCachingTransport(httpx.AsyncBaseTransport):
1919
def __init__(
2020
self,
2121
transport: httpx.AsyncBaseTransport,
22-
cache: AsyncDictCache = None,
22+
cache: Optional[AsyncDictCache] = None,
2323
cache_etags: bool = True,
24-
heuristic: BaseHeuristic = None,
24+
heuristic: Optional[BaseHeuristic] = None,
2525
cacheable_methods: Iterable[str] = ("GET",),
2626
cacheable_status_codes: Iterable[int] = (
2727
200,
@@ -103,7 +103,7 @@ async def _io_make_request(self, action: protocol.MakeRequest) -> Response:
103103
status_code=response.status_code,
104104
headers=response.headers,
105105
stream=response.stream, # type: ignore
106-
extensions=response.extensions,
106+
extensions=response.extensions, # type: ignore
107107
)
108108

109109
@aio_handler.register

httpx_caching/_sync/_transport.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ class SyncCachingTransport(httpx.BaseTransport):
1919
def __init__(
2020
self,
2121
transport: httpx.BaseTransport,
22-
cache: SyncDictCache = None,
22+
cache: Optional[SyncDictCache] = None,
2323
cache_etags: bool = True,
24-
heuristic: BaseHeuristic = None,
24+
heuristic: Optional[BaseHeuristic] = None,
2525
cacheable_methods: Iterable[str] = ("GET",),
2626
cacheable_status_codes: Iterable[int] = (
2727
200,
@@ -103,7 +103,7 @@ def _io_make_request(self, action: protocol.MakeRequest) -> Response:
103103
status_code=response.status_code,
104104
headers=response.headers,
105105
stream=response.stream, # type: ignore
106-
extensions=response.extensions,
106+
extensions=response.extensions, # type: ignore
107107
)
108108

109109
@io_handler.register

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ wheel==0.37.0
44

55
# Testing
66
autoflake==1.4
7-
black==22.1.0
8-
CherryPy==18.6.1
7+
black==22.3.0
8+
CherryPy==18.9.0
99
coverage==6.3.2
10-
flake8==4.0.1
11-
flake8-bugbear==22.1.11
10+
flake8==7.0.0
11+
flake8-bugbear==24.4.26
1212
freezegun==1.2.0
1313
isort==5.10.1
1414
mock==4.0.3

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def get_packages(package):
5454
include_package_data=True,
5555
zip_safe=False,
5656
install_requires=[
57-
"httpx==0.22.*",
57+
"httpx>=0.22.0",
5858
"msgpack",
5959
"anyio",
6060
"multimethod",
@@ -74,4 +74,4 @@ def get_packages(package):
7474
"Programming Language :: Python :: 3.10",
7575
"Programming Language :: Python :: 3 :: Only",
7676
],
77-
)
77+
)

tests/_async/test_vary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def assert_cached_equal(self, cached, resp):
2828
if "chunked" in resp.headers.get("transfer-encoding", ""):
2929
resp.headers.pop("transfer-encoding")
3030

31-
assert [cached.stream.read(), cached.headers, cached.status_code] == [
31+
assert [next(iter(cached.stream)), cached.headers, cached.status_code] == [
3232
resp.content,
3333
resp.headers,
3434
resp.status_code,

tests/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_read_version_v0(self):
3030
resp, _vary_fields = self.serializer._loads_v0(
3131
msgpack.dumps(self.response_data)
3232
)
33-
assert resp.stream.read() == b"Hello World"
33+
assert next(iter(resp.stream)) == b"Hello World"
3434

3535
def test_dumps(self):
3636
assert self.serializer.dumps(

0 commit comments

Comments
 (0)