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
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ repos:
hooks:
- id: pyupgrade
# Specify the oldest Python version that "cashews" supports.
args: [--py37-plus]
args: [--py310-plus]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand Down
4 changes: 2 additions & 2 deletions cashews/_typing.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from collections.abc import Awaitable, Iterable
from collections.abc import Awaitable, Callable, Iterable
from datetime import timedelta
from typing import TYPE_CHECKING, Any, Callable, Protocol, TypeVar, Union
from typing import TYPE_CHECKING, Any, Protocol, TypeVar, Union

if TYPE_CHECKING: # pragma: no cover
from . import Command
Expand Down
4 changes: 2 additions & 2 deletions cashews/decorators/bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import asyncio
import math
from collections import namedtuple
from collections.abc import Iterable
from collections.abc import Callable, Iterable
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, Union
from typing import TYPE_CHECKING, Any, Union

from cashews.backends.interface import Backend
from cashews.key import get_cache_key, get_cache_key_template
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/early.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import asyncio
import logging
from collections.abc import Callable
from datetime import datetime, timedelta, timezone
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.key import get_cache_key, get_cache_key_template
from cashews.ttl import ttl_to_seconds
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/fail.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.backends.interface import _BackendInterface
from cashews.key import get_cache_key, get_cache_key_template
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/hit.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import asyncio
from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.key import get_cache_key, get_cache_key_template
from cashews.ttl import ttl_to_seconds
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/iterator.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import time
from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.backends.interface import _BackendInterface
from cashews.key import get_cache_key, get_cache_key_template
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.key import get_cache_key, get_cache_key_template
from cashews.ttl import ttl_to_seconds
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/cache/soft.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import logging
from collections.abc import Callable
from datetime import datetime, timedelta, timezone
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.key import get_cache_key, get_cache_key_template
from cashews.ttl import ttl_to_seconds
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/circuit_breaker.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import random
from collections.abc import Callable
from datetime import datetime, timezone
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.backends.interface import _BackendInterface
from cashews.exceptions import CircuitBreakerOpen
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/locked.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

import asyncio
import inspect
from collections.abc import Callable
from functools import partial, wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews.backends.interface import _BackendInterface
from cashews.key import get_cache_key, get_cache_key_template
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/rate.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from __future__ import annotations

import logging
from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, NoReturn
from typing import TYPE_CHECKING, Any, NoReturn

from cashews.backends.interface import _BackendInterface
from cashews.exceptions import RateLimitError
Expand Down
3 changes: 2 additions & 1 deletion cashews/decorators/rate_slide.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import logging
from collections.abc import Callable
from datetime import datetime, timezone
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable, NoReturn
from typing import TYPE_CHECKING, Any, NoReturn

from cashews.backends.interface import _BackendInterface
from cashews.exceptions import RateLimitError
Expand Down
4 changes: 2 additions & 2 deletions cashews/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
import base64
import json
import re
from collections.abc import Iterable
from collections.abc import Callable, Iterable
from contextlib import contextmanager
from hashlib import md5, sha1, sha256
from re import Pattern
from string import Formatter
from typing import Any, Callable
from typing import Any

from . import key_context
from ._typing import KeyOrTemplate, KeyTemplate
Expand Down
4 changes: 2 additions & 2 deletions cashews/key.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from __future__ import annotations

import inspect
from collections.abc import Container, Iterable
from collections.abc import Callable, Container, Iterable
from functools import lru_cache
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any

from .exceptions import WrongKeyError
from .formatter import default_format, default_formatter
Expand Down
3 changes: 2 additions & 1 deletion cashews/wrapper/backend_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any, Callable, Union
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, Union
from urllib.parse import parse_qsl, urlparse

from cashews.backends.interface import Backend
Expand Down
3 changes: 2 additions & 1 deletion cashews/wrapper/decorators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from functools import wraps
from typing import TYPE_CHECKING, Callable
from typing import TYPE_CHECKING

from cashews import decorators, validation
from cashews.cache_condition import get_cache_condition
Expand Down
3 changes: 2 additions & 1 deletion cashews/wrapper/time_condition.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from __future__ import annotations

import time
from collections.abc import Callable
from contextvars import ContextVar
from functools import wraps
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING: # pragma: no cover
from cashews._typing import CallableCacheCondition, DecoratedFunc
Expand Down
3 changes: 2 additions & 1 deletion cashews/wrapper/wrapper.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from __future__ import annotations

from collections.abc import Callable
from functools import partial
from typing import TYPE_CHECKING, Any, Callable
from typing import TYPE_CHECKING, Any

from cashews import validation
from cashews.backends.interface import Backend
Expand Down
19 changes: 9 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,21 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Programming Language :: Python :: 3.13
Programming Language :: Python :: 3.14

[options]
python_requires = >=3.9
python_requires = >=3.10
packages = find:
include_package_data = true
zip_safe = false

[options.packages.find]
exclude =
tests
tests.*
tests*

[options.package_data]
cashews = py.typed
Expand All @@ -53,9 +52,9 @@ lint =
mypy >= 1.5.0
types-redis
tests =
pytest==8.4.2
pytest-asyncio==1.1.0
pytest-cov==6.2.1
pytest-randomly==3.16.0
pytest-rerunfailures==16.0.1
hypothesis==6.139.2
pytest==9.0.2
pytest-asyncio==1.3.0
pytest-cov==7.0.0
pytest-randomly==4.0.1
pytest-rerunfailures==16.1
hypothesis==6.148.7
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
{py39,py310,py311,py312,py313}-{redis,diskcache,integration}
{py310,py311,py312,py313,py314}-{redis,diskcache,integration}
coverage
skip_missing_interpreters = true

Expand Down
Loading