You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
general: set min version to 3.12; update ci to run 3.14
It's a bit of a toll to support so many versions, especially with new 3.12 type syntax and other goodies.
With pyenv/uv these days using custom python version is far easier than before and even preferred.
See [tests.test_types](src/cachew/tests/test_cachew.py#L684), [tests.test_primitive](src/cachew/tests/test_cachew.py#L722), [tests.test_dates](src/cachew/tests/test_cachew.py#L634), [tests.test_exceptions](src/cachew/tests/test_cachew.py#L1122)
149
-
*[@dataclass and NamedTuple](src/cachew/tests/test_cachew.py#L599)
See [tests.test_types](src/cachew/tests/test_cachew.py#L683), [tests.test_primitive](src/cachew/tests/test_cachew.py#L721), [tests.test_dates](src/cachew/tests/test_cachew.py#L633), [tests.test_exceptions](src/cachew/tests/test_cachew.py#L1125)
149
+
*[@dataclass and NamedTuple](src/cachew/tests/test_cachew.py#L598)
* detects [datatype schema changes](src/cachew/tests/test_cachew.py#L474) and discards old data automatically
154
+
* detects [datatype schema changes](src/cachew/tests/test_cachew.py#L471) and discards old data automatically
155
155
156
156
157
157
# Performance
@@ -165,20 +165,20 @@ You can find some of my performance tests in [benchmarks/](benchmarks) dir, and
165
165
166
166
167
167
# Using
168
-
See [docstring](src/cachew/__init__.py#L278) for up-to-date documentation on parameters and return types.
168
+
See [docstring](src/cachew/__init__.py#L270) for up-to-date documentation on parameters and return types.
169
169
You can also use [extensive unit tests](src/cachew/tests/test_cachew.py#L1) as a reference.
170
170
171
171
Some useful (but optional) arguments of `@cachew` decorator:
172
172
173
-
*`cache_path` can be a directory, or a callable that [returns a path](src/cachew/tests/test_cachew.py#L421) and depends on function's arguments.
173
+
*`cache_path` can be a directory, or a callable that [returns a path](src/cachew/tests/test_cachew.py#L418) and depends on function's arguments.
174
174
175
175
By default, `settings.DEFAULT_CACHEW_DIR` is used.
176
176
177
177
*`depends_on` is a function which determines whether your inputs have changed, and the cache needs to be invalidated.
178
178
179
179
By default it just uses string representation of the arguments, you can also specify a custom callable.
180
180
181
-
For instance, it can be used to [discard cache](src/cachew/tests/test_cachew.py#L118) if the input file was modified.
181
+
For instance, it can be used to [discard cache](src/cachew/tests/test_cachew.py#L115) if the input file was modified.
182
182
183
183
*`cls` is the type that would be serialized.
184
184
@@ -274,7 +274,7 @@ Now you can use `@mcachew` in place of `@cachew`, and be certain things don't br
274
274
## Settings
275
275
276
276
277
-
[cachew.settings](src/cachew/__init__.py#L61) exposes some parameters that allow you to control `cachew` behaviour:
277
+
[cachew.settings](src/cachew/__init__.py#L58) exposes some parameters that allow you to control `cachew` behaviour:
278
278
-`ENABLE`: set to `False` if you want to disable caching for without removing the decorators (useful for testing and debugging).
279
279
You can also use [cachew.extra.disabled_cachew](src/cachew/extra.py#L25) context manager to do it temporarily.
280
280
-`DEFAULT_CACHEW_DIR`: override to set a different base directory. The default is the "user cache directory" (see [platformdirs docs](https://github.com/tox-dev/platformdirs?tab=readme-ov-file#example-output)).
0 commit comments