Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
- '3.11'
- '3.10'
- '3.9'
- '3.8'
services:
nginx:
image: kennethreitz/httpbin
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
rev: v0.9.2
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.13.0
rev: v1.14.1
hooks:
- id: mypy
additional_dependencies: [attrs, aiohttp, types-aiofiles, types-redis]
Expand All @@ -23,6 +23,6 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/crate-ci/typos
rev: v1.28.1
rev: v1.29.4
hooks:
- id: typos
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

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

## 0.12.4 (2024-10-30)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ client requests, based on [requests-cache](https://github.com/reclosedev/request

# Quickstart

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

```bash
pip install aiohttp-client-cache[all]
Expand Down
4 changes: 2 additions & 2 deletions aiohttp_client_cache/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from inspect import Parameter, signature
from logging import getLogger
from typing import Callable, Dict
from typing import Callable

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


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

Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from collections import UserDict
from datetime import datetime
from logging import getLogger
from typing import Any, AsyncIterable, Awaitable, Callable, Iterable, Union
from typing import Any, Callable, Union
from collections.abc import AsyncIterable, Awaitable, Iterable

from aiohttp import ClientResponse
from aiohttp.typedefs import StrOrURL
Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/dynamodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

from contextlib import asynccontextmanager
from logging import getLogger
from typing import Any, AsyncIterable
from typing import Any
from collections.abc import AsyncIterable

import aioboto3
from aioboto3.session import ResourceCreatorContext
Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
from pickle import PickleError
from shutil import rmtree
from tempfile import gettempdir
from typing import Any, AsyncIterable
from typing import Any
from collections.abc import AsyncIterable

import aiofiles
import aiofiles.os
Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/mongodb.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import Any, AsyncIterable
from typing import Any
from collections.abc import AsyncIterable

from motor.motor_asyncio import AsyncIOMotorClient
from pymongo import MongoClient
Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/redis.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import Any, AsyncIterable
from typing import Any
from collections.abc import AsyncIterable

from redis.asyncio import Redis, from_url

Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/backends/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
from os.path import abspath, basename, dirname, expanduser, isabs, join
from pathlib import Path
from tempfile import gettempdir
from typing import Any, AsyncIterable, AsyncIterator
from typing import Any
from collections.abc import AsyncIterable, AsyncIterator

import aiosqlite

Expand Down
7 changes: 4 additions & 3 deletions aiohttp_client_cache/cache_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
from functools import singledispatch
from itertools import chain
from logging import getLogger
from typing import Any, Dict, Mapping, NoReturn, Tuple, Union
from typing import Any, NoReturn, Union
from collections.abc import Mapping

from aiohttp import ClientResponse
from aiohttp.typedefs import StrOrURL
Expand All @@ -32,9 +33,9 @@
]
RESPONSE_CACHE_HEADERS = ['Cache-Control', 'ETag', 'Expires', 'Age']

CacheDirective = Tuple[str, Union[None, int, bool]]
CacheDirective = tuple[str, Union[None, int, bool]]
ExpirationTime = Union[None, int, float, str, datetime, timedelta]
ExpirationPatterns = Dict[str, ExpirationTime]
ExpirationPatterns = dict[str, ExpirationTime]
logger = getLogger(__name__)


Expand Down
3 changes: 2 additions & 1 deletion aiohttp_client_cache/cache_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import hashlib
from collections.abc import Mapping
from typing import Any, Iterable, Sequence, Union
from typing import Any, Union
from collections.abc import Iterable, Sequence

from aiohttp.typedefs import StrOrURL
from multidict import MultiDict
Expand Down
9 changes: 5 additions & 4 deletions aiohttp_client_cache/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from functools import singledispatch
from http.cookies import SimpleCookie
from logging import getLogger
from typing import Any, Dict, List, Mapping, Optional, Tuple, Union
from typing import Any, Optional, Union
from collections.abc import Mapping
from unittest.mock import Mock

import attr
Expand Down Expand Up @@ -44,9 +45,9 @@
'is_expired': False,
}

JsonResponse = Optional[Dict[str, Any]]
DictItems = List[Tuple[str, str]]
LinkItems = List[Tuple[str, DictItems]]
JsonResponse = Optional[dict[str, Any]]
DictItems = list[tuple[str, str]]
LinkItems = list[tuple[str, DictItems]]
LinkMultiDict = MultiDictProxy[MultiDictProxy[Union[str, URL]]]

logger = getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ conda install -c conda-forge aiohttp-client-cache

### Requirements

- Requires python 3.8+.
- Requires python 3.9+.
- You may need additional dependencies depending on which backend you want to use. To install with
extra dependencies for all supported {ref}`backends`:
```bash
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
XDIST_ARGS = '--numprocesses=auto --dist=loadfile' # Run tests in parallel, grouped by test module


@session(python=['3.8', '3.9', '3.10', '3.11', '3.12'])
@session(python=['3.9', '3.10', '3.11', '3.12'])
def test(session):
"""Run tests for a specific python version"""
test_paths = session.posargs or [UNIT_TESTS]
Expand Down
48 changes: 3 additions & 45 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
"Documentation" = "https://aiohttp-client-cache.readthedocs.io"

[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
aiohttp = "^3.8"
attrs = ">=21.2"
itsdangerous = ">=2.0"
Expand Down Expand Up @@ -111,7 +111,7 @@ exclude_lines = [
]

[tool.mypy]
python_version = 3.8
python_version = 3.9
ignore_missing_imports = true
warn_redundant_casts = true
warn_unused_ignores = true
Expand All @@ -125,7 +125,7 @@ exclude = "dist|build"
[tool.ruff]
line-length = 100
output-format = 'grouped'
target-version = 'py38'
target-version = 'py39'

[tool.ruff.format]
quote-style = 'single'
Expand Down
Loading
Loading