Skip to content

Commit d3b000a

Browse files
Add support for Python 3.14 and end support of Python 3.9 (#340)
* Also test on Python 3.14 * chore: drop Python 3.9 from CI and package metadata * fix: add explicit strict flag to zip in arg mapping * revert weird addition * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix: add explicit strict flag to zip in arg mapping --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 85539dc commit d3b000a

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.github/copilot-instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Welcome to the Cachier codebase! Please follow these guidelines to ensure code s
3838
## 6. Backward Compatibility
3939

4040
- Maintain backward compatibility for public APIs unless a breaking change is explicitly approved.
41-
- Cachier supports Python 3.9+.
41+
- Cachier supports Python 3.10+.
4242

4343
## 7. Documentation and Examples
4444

.github/workflows/ci-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
strategy:
2424
fail-fast: false
2525
matrix:
26-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
26+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
2727
os: ["ubuntu-latest", "macOS-latest", "windows-latest"]
2828
backend: ["local", "mongodb", "postgres", "redis"]
2929
exclude:

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**Cachier** is a Python library providing persistent, stale-free, local and cross-machine caching for Python functions via a decorator API. It supports multiple backends (pickle, memory, MongoDB, SQL, Redis), is thread-safe, and is designed for extensibility and robust cross-platform support.
66

77
- **Repository:** [python-cachier/cachier](https://github.com/python-cachier/cachier)
8-
- **Primary Language:** Python 3.9+
8+
- **Primary Language:** Python 3.10+
99
- **Key Dependencies:** `portalocker`, `watchdog` (optional: `pymongo`, `sqlalchemy`, `redis`)
1010
- **Test Framework:** `pytest` with backend-specific markers
1111
- **Linting:** `ruff` (replaces black/flake8)
@@ -98,7 +98,7 @@ ______________________________________________________________________
9898

9999
### 1. **Code Style & Quality**
100100

101-
- **Python 3.9+** only.
101+
- **Python 3.10+** only.
102102
- **Type annotations** required for all new code.
103103
- **Docstrings:** Use numpy style, multi-line, no single-line docstrings.
104104
- **Lint:** Run `ruff` before PRs. Use per-line/file ignores only for justified cases.
@@ -145,7 +145,7 @@ ______________________________________________________________________
145145
### 7. **Backward Compatibility**
146146

147147
- **Public API must remain backward compatible** unless breaking change is approved.
148-
- **Support for Python 3.9+ only.**
148+
- **Support for Python 3.10+ only.**
149149

150150
### 8. **Global Configuration & Compatibility**
151151

@@ -565,7 +565,7 @@ ______________________________________________________________________
565565
- **When adding new features/backends, update all relevant docs, tests, CI, and requirements files.**
566566
- **If a test fails due to missing optional dependency, skip gracefully.**
567567
- **Never emit warnings/errors for missing optional deps at import time.**
568-
- **All code must be Python 3.9+ compatible.**
568+
- **All code must be Python 3.10+ compatible.**
569569
- **All new code must have full type annotations and numpy-style docstrings.**
570570
- **Backend consistency:** Ensure all backends (pickle, memory, mongo, sql, redis) are supported.\*\*
571571
- **Validation:** Test examples in this file work: `python -c "from cachier import cachier; ..."` should succeed.

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Current features
4747
----------------
4848

4949
* Pure Python.
50-
* Compatible with Python 3.9+ (Python 2.7 was discontinued in version 1.2.8).
50+
* Compatible with Python 3.10+ (Python 2.7 was discontinued in version 1.2.8).
5151
* Supported and `tested on Linux, OS X and Windows <https://travis-ci.org/shaypal5/cachier>`_.
5252
* A simple interface.
5353
* Defining "shelf life" for cached values.

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,13 @@ license = { file = "LICENSE" }
2424
authors = [
2525
{ name = "Shay Palachy Affek", email = 'shay.palachy@gmail.com' },
2626
]
27-
requires-python = ">=3.9"
27+
requires-python = ">=3.10"
2828
classifiers = [
2929
"Development Status :: 4 - Beta",
3030
"Intended Audience :: Developers",
3131
"License :: OSI Approved :: MIT License",
3232
"Programming Language :: Python",
3333
"Programming Language :: Python :: 3 :: Only",
34-
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
@@ -75,7 +74,7 @@ namespaces = false # to disable scanning PEP 420 namespaces (true by default)
7574
# --- ruff ---
7675

7776
[tool.ruff]
78-
target-version = "py39"
77+
target-version = "py310"
7978
line-length = 120
8079
# Exclude a variety of commonly ignored directories.
8180
exclude = [

src/cachier/core.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _convert_args_kwargs(func, _is_method: bool, args: tuple, kwds: dict) -> dic
125125

126126
# Map as many args as possible to regular parameters
127127
num_regular = len(params_to_use)
128-
args_as_kw = dict(zip(params_to_use, args_to_map[:num_regular]))
128+
args_as_kw = dict(zip(params_to_use, args_to_map[:num_regular], strict=False))
129129

130130
# Handle variadic positional arguments
131131
# Store them with indexed keys like __varargs_0__, __varargs_1__, etc.
@@ -286,7 +286,9 @@ def cachier(
286286
)
287287
elif backend == "memory":
288288
core = _MemoryCore(
289-
hash_func=hash_func, wait_for_calc_timeout=wait_for_calc_timeout, entry_size_limit=size_limit_bytes
289+
hash_func=hash_func,
290+
wait_for_calc_timeout=wait_for_calc_timeout,
291+
entry_size_limit=size_limit_bytes,
290292
)
291293
elif backend == "sql":
292294
core = _SQLCore(
@@ -549,6 +551,7 @@ async def _call_async(*args, max_age: Optional[timedelta] = None, **kwds):
549551
@wraps(func)
550552
async def func_wrapper(*args, **kwargs):
551553
return await _call_async(*args, **kwargs)
554+
552555
else:
553556

554557
@wraps(func)

0 commit comments

Comments
 (0)