Skip to content

Commit 71574da

Browse files
authored
Merge pull request #303 from alessio-locatelli/drop_python_3.8
Drop Python 3.8 due to the EOL
2 parents 6d60cbc + 8d28ac7 commit 71574da

25 files changed

+51
-86
lines changed

.github/workflows/build.yml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
- '3.11'
2525
- '3.10'
2626
- '3.9'
27-
- '3.8'
2827
services:
2928
nginx:
3029
image: kennethreitz/httpbin

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ repos:
88
- id: mixed-line-ending
99
- id: trailing-whitespace
1010
- repo: https://github.com/astral-sh/ruff-pre-commit
11-
rev: v0.8.1
11+
rev: v0.9.2
1212
hooks:
1313
- id: ruff
1414
args: [--fix]
1515
- id: ruff-format
1616
- repo: https://github.com/pre-commit/mirrors-mypy
17-
rev: v1.13.0
17+
rev: v1.14.1
1818
hooks:
1919
- id: mypy
2020
additional_dependencies: [attrs, aiohttp, types-aiofiles, types-redis]
@@ -23,6 +23,6 @@ repos:
2323
hooks:
2424
- id: prettier
2525
- repo: https://github.com/crate-ci/typos
26-
rev: v1.28.1
26+
rev: v1.29.4
2727
hooks:
2828
- id: typos

HISTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fixed `CachedResponse.read()` to be consistent with `ClientResponse.read()` by allowing to call `read()` multiple times. (#289)
66
- Now a warning is raised when a cache backend is accessed after disconnecting (after exiting the `CachedSession` context manager). (#241)
7+
- Dropped Python 3.8 support due to the EOL.
78

89
## 0.12.4 (2024-10-30)
910

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ client requests, based on [requests-cache](https://github.com/reclosedev/request
2424

2525
# Quickstart
2626

27-
First, install with pip (python 3.8+ required):
27+
First, install with pip (python 3.9+ required):
2828

2929
```bash
3030
pip install aiohttp-client-cache[all]

aiohttp_client_cache/backends/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from inspect import Parameter, signature
22
from logging import getLogger
3-
from typing import Callable, Dict
3+
from typing import Callable
44

55
from aiohttp_client_cache.backends.base import ( # noqa: F401
66
BaseCache,
@@ -25,7 +25,7 @@ def __init__(*args, **kwargs):
2525
return PlaceholderBackend
2626

2727

28-
def get_valid_kwargs(func: Callable, kwargs: Dict, accept_varkwargs: bool = True) -> Dict:
28+
def get_valid_kwargs(func: Callable, kwargs: dict, accept_varkwargs: bool = True) -> dict:
2929
"""Get the subset of non-None ``kwargs`` that are valid params for ``func``"""
3030
params = signature(func).parameters
3131

aiohttp_client_cache/backends/base.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from collections import UserDict
77
from datetime import datetime
88
from logging import getLogger
9-
from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Union
9+
from typing import Any, Callable, Union
10+
from collections.abc import AsyncIterable, Awaitable, Iterable
1011

1112
from aiohttp import ClientResponse
1213
from aiohttp.typedefs import StrOrURL

aiohttp_client_cache/backends/dynamodb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from contextlib import asynccontextmanager
44
from logging import getLogger
5-
from typing import Any, AsyncIterable
5+
from typing import Any
6+
from collections.abc import AsyncIterable
67

78
import aioboto3
89
from aioboto3.session import ResourceCreatorContext

aiohttp_client_cache/backends/filesystem.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
from pickle import PickleError
88
from shutil import rmtree
99
from tempfile import gettempdir
10-
from typing import Any, AsyncIterable
10+
from typing import Any
11+
from collections.abc import AsyncIterable
1112

1213
import aiofiles
1314
import aiofiles.os

aiohttp_client_cache/backends/mongodb.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import Any, AsyncIterable
3+
from typing import Any
4+
from collections.abc import AsyncIterable
45

56
from motor.motor_asyncio import AsyncIOMotorClient
67
from pymongo import MongoClient

aiohttp_client_cache/backends/redis.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import Any, AsyncIterable
3+
from typing import Any
4+
from collections.abc import AsyncIterable
45

56
from redis.asyncio import Redis, from_url
67

aiohttp_client_cache/backends/sqlite.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
from os.path import abspath, basename, dirname, expanduser, isabs, join
1212
from pathlib import Path
1313
from tempfile import gettempdir
14-
from typing import Any, AsyncIterable, AsyncIterator
14+
from typing import Any
15+
from collections.abc import AsyncIterable, AsyncIterator
1516

1617
import aiosqlite
1718

aiohttp_client_cache/cache_control.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
from functools import singledispatch
1010
from itertools import chain
1111
from logging import getLogger
12-
from typing import Any, Dict, Mapping, NoReturn, Tuple, Union
12+
from typing import Any, NoReturn, Union
13+
from collections.abc import Mapping
1314

1415
from aiohttp import ClientResponse
1516
from aiohttp.typedefs import StrOrURL
@@ -32,9 +33,9 @@
3233
]
3334
RESPONSE_CACHE_HEADERS = ['Cache-Control', 'ETag', 'Expires', 'Age']
3435

35-
CacheDirective = Tuple[str, Union[None, int, bool]]
36+
CacheDirective = tuple[str, Union[None, int, bool]]
3637
ExpirationTime = Union[None, int, float, str, datetime, timedelta]
37-
ExpirationPatterns = Dict[str, ExpirationTime]
38+
ExpirationPatterns = dict[str, ExpirationTime]
3839
logger = getLogger(__name__)
3940

4041

aiohttp_client_cache/cache_keys.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
import hashlib
66
from collections.abc import Mapping
7-
from typing import Any, Iterable, Sequence, Union
7+
from typing import Any, Union
8+
from collections.abc import Iterable, Sequence
89

910
from aiohttp.typedefs import StrOrURL
1011
from multidict import MultiDict

aiohttp_client_cache/response.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from functools import singledispatch
99
from http.cookies import SimpleCookie
1010
from logging import getLogger
11-
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
11+
from typing import Any, Optional, Union
12+
from collections.abc import Mapping
1213
from unittest.mock import Mock
1314

1415
import attr
@@ -44,9 +45,9 @@
4445
'is_expired': False,
4546
}
4647

47-
JsonResponse = Optional[Dict[str, Any]]
48-
DictItems = List[Tuple[str, str]]
49-
LinkItems = List[Tuple[str, DictItems]]
48+
JsonResponse = Optional[dict[str, Any]]
49+
DictItems = list[tuple[str, str]]
50+
LinkItems = list[tuple[str, DictItems]]
5051
LinkMultiDict = MultiDictProxy[MultiDictProxy[Union[str, URL]]]
5152

5253
logger = getLogger(__name__)

docs/user_guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ conda install -c conda-forge aiohttp-client-cache
1818

1919
### Requirements
2020

21-
- Requires python 3.8+.
21+
- Requires python 3.9+.
2222
- You may need additional dependencies depending on which backend you want to use. To install with
2323
extra dependencies for all supported {ref}`backends`:
2424
```bash

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
XDIST_ARGS = '--numprocesses=auto --dist=loadfile' # Run tests in parallel, grouped by test module
3030

3131

32-
@session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
32+
@session(python=['3.9', '3.10', '3.11', '3.12'])
3333
def test(session):
3434
"""Run tests for a specific python version"""
3535
test_paths = session.posargs or [UNIT_TESTS]

poetry.lock

+3-45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classifiers = [
3030
"Documentation" = "https://aiohttp-client-cache.readthedocs.io"
3131

3232
[tool.poetry.dependencies]
33-
python = "^3.8"
33+
python = "^3.9"
3434
aiohttp = "^3.8"
3535
attrs = ">=21.2"
3636
itsdangerous = ">=2.0"
@@ -111,7 +111,7 @@ exclude_lines = [
111111
]
112112

113113
[tool.mypy]
114-
python_version = 3.8
114+
python_version = 3.9
115115
ignore_missing_imports = true
116116
warn_redundant_casts = true
117117
warn_unused_ignores = true
@@ -125,7 +125,7 @@ exclude = "dist|build"
125125
[tool.ruff]
126126
line-length = 100
127127
output-format = 'grouped'
128-
target-version = 'py38'
128+
target-version = 'py39'
129129

130130
[tool.ruff.format]
131131
quote-style = 'single'

0 commit comments

Comments
 (0)