cachepot 0.3.0__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cachepot-0.4.0/.github/workflows/gitignore-in.yml +16 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/.github/workflows/happy.yml +1 -1
- {cachepot-0.3.0 → cachepot-0.4.0}/.github/workflows/pypi-publish.yml +4 -4
- {cachepot-0.3.0 → cachepot-0.4.0}/.github/workflows/python-test.yml +13 -7
- {cachepot-0.3.0 → cachepot-0.4.0}/.gitignore +20 -13
- cachepot-0.4.0/.gitignore.in +5 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/PKG-INFO +3 -3
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/_version.py +2 -2
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/backend/__init__.py +3 -6
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/serializer/__init__.py +2 -4
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/store/__init__.py +9 -11
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot.egg-info/PKG-INFO +3 -3
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot.egg-info/SOURCES.txt +1 -1
- cachepot-0.4.0/poetry.lock +732 -0
- cachepot-0.4.0/pyproject.toml +45 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/setup.cfg +2 -2
- cachepot-0.3.0/.gitignore.in +0 -10
- cachepot-0.3.0/.isort.cfg +0 -4
- cachepot-0.3.0/poetry.lock +0 -748
- cachepot-0.3.0/pyproject.toml +0 -72
- {cachepot-0.3.0 → cachepot-0.4.0}/.github/renovate.json5 +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/.github/workflows/spellcheck.yml +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/LICENSE +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/README.md +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/__init__.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/backend/filesystem.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/backend/redis.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/backend/sqlite.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/expire.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/py.typed +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/serializer/json.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/serializer/pickle.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot/serializer/str.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot.egg-info/dependency_links.txt +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot.egg-info/requires.txt +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/cachepot.egg-info/top_level.txt +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/docker-compose.test.yml +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/example/__init__.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/__init__.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/backend/__init__.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/backend/test_filesystem.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/backend/test_redis.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/backend/test_sqlite.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/serializer/__init__.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/serializer/test_json.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/serializer/test_pickle.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/serializer/test_str.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/test_expire.py +0 -0
- {cachepot-0.3.0 → cachepot-0.4.0}/tests/test_store.py +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: Update gitignore file
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
# daily at 00:00
|
|
6
|
+
- cron: '0 0 * * *'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
update-gitignore:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: gitignore-in/gh-action@v0.2.2
|
|
@@ -8,7 +8,7 @@ on:
|
|
|
8
8
|
types: [prereleased, released]
|
|
9
9
|
|
|
10
10
|
env:
|
|
11
|
-
python_version: 3.
|
|
11
|
+
python_version: 3.13
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
14
14
|
deploy:
|
|
@@ -18,15 +18,15 @@ jobs:
|
|
|
18
18
|
|
|
19
19
|
- name: Set up Python
|
|
20
20
|
id: setup-python
|
|
21
|
-
uses: actions/setup-python@
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
22
|
with:
|
|
23
23
|
python-version: ${{ env.python_version }}
|
|
24
24
|
|
|
25
25
|
- name: Set up poetry
|
|
26
|
-
uses: abatilo/actions-poetry@
|
|
26
|
+
uses: abatilo/actions-poetry@v3
|
|
27
27
|
|
|
28
28
|
- name: Cache
|
|
29
|
-
uses: actions/cache@
|
|
29
|
+
uses: actions/cache@v4
|
|
30
30
|
with:
|
|
31
31
|
path: ~/.cache/pypoetry/virtualenvs
|
|
32
32
|
key: ${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
name: Test
|
|
2
2
|
on:
|
|
3
|
-
-
|
|
3
|
+
# pull-request events are not triggered when a PR is merged
|
|
4
|
+
# push events are not triggered when a PR created from a fork repository
|
|
5
|
+
# So we need both to run tests on every PR and after merging
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
4
10
|
|
|
5
11
|
jobs:
|
|
6
12
|
test:
|
|
@@ -8,7 +14,7 @@ jobs:
|
|
|
8
14
|
strategy:
|
|
9
15
|
fail-fast: false
|
|
10
16
|
matrix:
|
|
11
|
-
python: ["3.
|
|
17
|
+
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
12
18
|
|
|
13
19
|
services:
|
|
14
20
|
redis:
|
|
@@ -27,15 +33,15 @@ jobs:
|
|
|
27
33
|
|
|
28
34
|
- name: Set up Python
|
|
29
35
|
id: setup-python
|
|
30
|
-
uses: actions/setup-python@
|
|
36
|
+
uses: actions/setup-python@v5
|
|
31
37
|
with:
|
|
32
38
|
python-version: "${{ matrix.python }}"
|
|
33
39
|
|
|
34
40
|
- name: Set up poetry
|
|
35
|
-
uses: abatilo/actions-poetry@
|
|
41
|
+
uses: abatilo/actions-poetry@v3
|
|
36
42
|
|
|
37
43
|
- name: Cache
|
|
38
|
-
uses: actions/cache@
|
|
44
|
+
uses: actions/cache@v4
|
|
39
45
|
with:
|
|
40
46
|
path: ~/.cache/pypoetry/virtualenvs
|
|
41
47
|
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
|
|
@@ -66,8 +72,8 @@ jobs:
|
|
|
66
72
|
run: poetry run poe coverage-xml
|
|
67
73
|
|
|
68
74
|
- name: Upload coverage report to Codecov
|
|
69
|
-
if: matrix.python == '3.
|
|
70
|
-
uses: codecov/codecov-action@
|
|
75
|
+
if: matrix.python == '3.13'
|
|
76
|
+
uses: codecov/codecov-action@v4
|
|
71
77
|
with:
|
|
72
78
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
73
79
|
files: ./coverage.xml
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
# DO NOT EDIT THIS FILE
|
|
2
|
+
# Generated by gitignore.in
|
|
3
|
+
# Edit .gitignore.in instead of this file
|
|
4
|
+
# Run `gitignore.in` to build .gitignore
|
|
5
|
+
# -----------------------------------------------------------------------------
|
|
6
|
+
# gibo dump Linux
|
|
1
7
|
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
|
2
|
-
### https://raw.github.com/github/gitignore/
|
|
8
|
+
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/Linux.gitignore
|
|
3
9
|
|
|
4
10
|
*~
|
|
5
11
|
|
|
@@ -14,10 +20,10 @@
|
|
|
14
20
|
|
|
15
21
|
# .nfs files are created when an open file is removed but is still being accessed
|
|
16
22
|
.nfs*
|
|
17
|
-
|
|
18
|
-
|
|
23
|
+
# -----------------------------------------------------------------------------
|
|
24
|
+
# gibo dump Windows
|
|
19
25
|
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
|
20
|
-
### https://raw.github.com/github/gitignore/
|
|
26
|
+
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/Windows.gitignore
|
|
21
27
|
|
|
22
28
|
# Windows thumbnail cache files
|
|
23
29
|
Thumbs.db
|
|
@@ -43,10 +49,10 @@ $RECYCLE.BIN/
|
|
|
43
49
|
|
|
44
50
|
# Windows shortcuts
|
|
45
51
|
*.lnk
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
# -----------------------------------------------------------------------------
|
|
53
|
+
# gibo dump macOS
|
|
48
54
|
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
|
49
|
-
### https://raw.github.com/github/gitignore/
|
|
55
|
+
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Global/macOS.gitignore
|
|
50
56
|
|
|
51
57
|
# General
|
|
52
58
|
.DS_Store
|
|
@@ -74,10 +80,10 @@ Icon
|
|
|
74
80
|
Network Trash Folder
|
|
75
81
|
Temporary Items
|
|
76
82
|
.apdisk
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
# -----------------------------------------------------------------------------
|
|
84
|
+
# gibo dump Python
|
|
79
85
|
### Generated by gibo (https://github.com/simonwhitaker/gibo)
|
|
80
|
-
### https://raw.github.com/github/gitignore/
|
|
86
|
+
### https://raw.github.com/github/gitignore/33243d9491911332228307c915ff95707791a91f/Python.gitignore
|
|
81
87
|
|
|
82
88
|
# Byte-compiled / optimized / DLL files
|
|
83
89
|
__pycache__/
|
|
@@ -187,8 +193,10 @@ ipython_config.py
|
|
|
187
193
|
#pdm.lock
|
|
188
194
|
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
189
195
|
# in version control.
|
|
190
|
-
# https://pdm.fming.dev/#
|
|
196
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
191
197
|
.pdm.toml
|
|
198
|
+
.pdm-python
|
|
199
|
+
.pdm-build/
|
|
192
200
|
|
|
193
201
|
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
194
202
|
__pypackages__/
|
|
@@ -239,6 +247,5 @@ cython_debug/
|
|
|
239
247
|
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
240
248
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
241
249
|
#.idea/
|
|
242
|
-
|
|
243
|
-
|
|
250
|
+
# -----------------------------------------------------------------------------
|
|
244
251
|
_version.py
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cachepot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Yet another Python cache library
|
|
5
5
|
Home-page: https://github.com/kitsuyui/cachepot
|
|
6
6
|
Author: Yui Kitsu
|
|
@@ -8,14 +8,14 @@ Author-email: kitsuyui+github@kitsuyui.com
|
|
|
8
8
|
License: BSD-3-Clause
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
10
10
|
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Intended Audience :: Developers
|
|
17
17
|
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: typing-extensions
|
|
@@ -8,11 +8,8 @@ from cachepot.expire import ExpireSeconds
|
|
|
8
8
|
class CacheBackendProtocol(Protocol):
|
|
9
9
|
def save(
|
|
10
10
|
self, key: bytes, value: bytes, *, expire_seconds: ExpireSeconds
|
|
11
|
-
) -> None:
|
|
12
|
-
...
|
|
11
|
+
) -> None: ...
|
|
13
12
|
|
|
14
|
-
def load(self, key: bytes) -> Optional[bytes]:
|
|
15
|
-
...
|
|
13
|
+
def load(self, key: bytes) -> Optional[bytes]: ...
|
|
16
14
|
|
|
17
|
-
def delete(self, key: bytes) -> None:
|
|
18
|
-
...
|
|
15
|
+
def delete(self, key: bytes) -> None: ...
|
|
@@ -6,8 +6,6 @@ T = TypeVar("T")
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class SerializerProtocol(Protocol[T]):
|
|
9
|
-
def serialize(self, data: T) -> bytes:
|
|
10
|
-
...
|
|
9
|
+
def serialize(self, data: T) -> bytes: ...
|
|
11
10
|
|
|
12
|
-
def deserialize(self, serialized_data: bytes) -> T:
|
|
13
|
-
...
|
|
11
|
+
def deserialize(self, serialized_data: bytes) -> T: ...
|
|
@@ -11,23 +11,21 @@ S = TypeVar("S")
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class CacheStoreProtocol(Protocol[T, S]):
|
|
14
|
-
def get(self, key: T) -> Optional[S]:
|
|
15
|
-
...
|
|
14
|
+
def get(self, key: T) -> Optional[S]: ...
|
|
16
15
|
|
|
17
16
|
def put(
|
|
18
17
|
self,
|
|
19
18
|
key: T,
|
|
20
19
|
value: S,
|
|
21
20
|
*,
|
|
22
|
-
expire_seconds: Optional[ExpireSeconds] = None
|
|
23
|
-
) -> None:
|
|
24
|
-
...
|
|
21
|
+
expire_seconds: Optional[ExpireSeconds] = None,
|
|
22
|
+
) -> None: ...
|
|
25
23
|
|
|
26
|
-
def proxy(
|
|
27
|
-
|
|
24
|
+
def proxy(
|
|
25
|
+
self, original_function: Callable[..., S]
|
|
26
|
+
) -> Callable[..., S]: ...
|
|
28
27
|
|
|
29
|
-
def remove(self, key: T) -> None:
|
|
30
|
-
...
|
|
28
|
+
def remove(self, key: T) -> None: ...
|
|
31
29
|
|
|
32
30
|
|
|
33
31
|
class CacheStore(CacheStoreProtocol[T, S]):
|
|
@@ -67,7 +65,7 @@ class CacheStore(CacheStoreProtocol[T, S]):
|
|
|
67
65
|
key: T,
|
|
68
66
|
value: S,
|
|
69
67
|
*,
|
|
70
|
-
expire_seconds: Optional[ExpireSeconds] = None
|
|
68
|
+
expire_seconds: Optional[ExpireSeconds] = None,
|
|
71
69
|
) -> None:
|
|
72
70
|
if expire_seconds is None:
|
|
73
71
|
expire_seconds = self.default_expire_seconds
|
|
@@ -82,7 +80,7 @@ class CacheStore(CacheStoreProtocol[T, S]):
|
|
|
82
80
|
*args: Any,
|
|
83
81
|
cache_key: T,
|
|
84
82
|
expire_seconds: Optional[ExpireSeconds] = None,
|
|
85
|
-
**kwargs: Any
|
|
83
|
+
**kwargs: Any,
|
|
86
84
|
) -> S:
|
|
87
85
|
cached_result = self.get(cache_key)
|
|
88
86
|
if cached_result is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cachepot
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Yet another Python cache library
|
|
5
5
|
Home-page: https://github.com/kitsuyui/cachepot
|
|
6
6
|
Author: Yui Kitsu
|
|
@@ -8,14 +8,14 @@ Author-email: kitsuyui+github@kitsuyui.com
|
|
|
8
8
|
License: BSD-3-Clause
|
|
9
9
|
Classifier: Development Status :: 3 - Alpha
|
|
10
10
|
Classifier: License :: OSI Approved :: BSD License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
12
11
|
Classifier: Programming Language :: Python :: 3.9
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Intended Audience :: Developers
|
|
17
17
|
Classifier: Topic :: Software Development :: Libraries
|
|
18
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: typing-extensions
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
.gitignore
|
|
2
2
|
.gitignore.in
|
|
3
|
-
.isort.cfg
|
|
4
3
|
LICENSE
|
|
5
4
|
README.md
|
|
6
5
|
docker-compose.test.yml
|
|
@@ -8,6 +7,7 @@ poetry.lock
|
|
|
8
7
|
pyproject.toml
|
|
9
8
|
setup.cfg
|
|
10
9
|
.github/renovate.json5
|
|
10
|
+
.github/workflows/gitignore-in.yml
|
|
11
11
|
.github/workflows/happy.yml
|
|
12
12
|
.github/workflows/pypi-publish.yml
|
|
13
13
|
.github/workflows/python-test.yml
|