Skip to content

Commit

Permalink
Merge branch 'johtso:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ekrekeler authored Oct 26, 2024
2 parents ffce92d + 7b1f266 commit dedfe1b
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: "actions/checkout@v2"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ 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/).

## 0.1a4 (17th May, 2024)

Remove httpx version cap
Stop testing on Python 3.7

## 0.1a3 (23rd August, 2023)

Bump httpx version to 0.23.

## 0.1a2 (18th February, 2022)

Replace print statements with logging.
Expand Down
2 changes: 1 addition & 1 deletion httpx_caching/__version__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__title__ = "httpx-caching"
__description__ = "Caching for HTTPX."
__version__ = "0.1a2"
__version__ = "0.1a4"
6 changes: 3 additions & 3 deletions httpx_caching/_async/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class AsyncCachingTransport(httpx.AsyncBaseTransport):
def __init__(
self,
transport: httpx.AsyncBaseTransport,
cache: AsyncDictCache = None,
cache: Optional[AsyncDictCache] = None,
cache_etags: bool = True,
heuristic: BaseHeuristic = None,
heuristic: Optional[BaseHeuristic] = None,
cacheable_methods: Iterable[str] = ("GET",),
cacheable_status_codes: Iterable[int] = (
200,
Expand Down Expand Up @@ -103,7 +103,7 @@ async def _io_make_request(self, action: protocol.MakeRequest) -> Response:
status_code=response.status_code,
headers=response.headers,
stream=response.stream, # type: ignore
extensions=response.extensions,
extensions=response.extensions, # type: ignore
)

@aio_handler.register
Expand Down
6 changes: 3 additions & 3 deletions httpx_caching/_sync/_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class SyncCachingTransport(httpx.BaseTransport):
def __init__(
self,
transport: httpx.BaseTransport,
cache: SyncDictCache = None,
cache: Optional[SyncDictCache] = None,
cache_etags: bool = True,
heuristic: BaseHeuristic = None,
heuristic: Optional[BaseHeuristic] = None,
cacheable_methods: Iterable[str] = ("GET",),
cacheable_status_codes: Iterable[int] = (
200,
Expand Down Expand Up @@ -103,7 +103,7 @@ def _io_make_request(self, action: protocol.MakeRequest) -> Response:
status_code=response.status_code,
headers=response.headers,
stream=response.stream, # type: ignore
extensions=response.extensions,
extensions=response.extensions, # type: ignore
)

@io_handler.register
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ wheel==0.37.0

# Testing
autoflake==1.4
black==22.1.0
CherryPy==18.6.1
black==22.3.0
CherryPy==18.9.0
coverage==6.3.2
flake8==4.0.1
flake8-bugbear==22.1.11
flake8==7.0.0
flake8-bugbear==24.4.26
freezegun==1.2.0
isort==5.10.1
mock==4.0.3
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_packages(package):
include_package_data=True,
zip_safe=False,
install_requires=[
"httpx==0.22.*",
"httpx>=0.22.0",
"msgpack",
"anyio",
"multimethod",
Expand All @@ -74,4 +74,4 @@ def get_packages(package):
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3 :: Only",
],
)
)
2 changes: 1 addition & 1 deletion tests/_async/test_vary.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def assert_cached_equal(self, cached, resp):
if "chunked" in resp.headers.get("transfer-encoding", ""):
resp.headers.pop("transfer-encoding")

assert [cached.stream.read(), cached.headers, cached.status_code] == [
assert [next(iter(cached.stream)), cached.headers, cached.status_code] == [
resp.content,
resp.headers,
resp.status_code,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_read_version_v0(self):
resp, _vary_fields = self.serializer._loads_v0(
msgpack.dumps(self.response_data)
)
assert resp.stream.read() == b"Hello World"
assert next(iter(resp.stream)) == b"Hello World"

def test_dumps(self):
assert self.serializer.dumps(
Expand Down

0 comments on commit dedfe1b

Please sign in to comment.