cachedir 0.1.1__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.
Files changed (51) hide show
  1. cachedir-0.1.1/.bumpversion.cfg +8 -0
  2. cachedir-0.1.1/.codecov.yaml +17 -0
  3. cachedir-0.1.1/.coveragerc +22 -0
  4. cachedir-0.1.1/.editorconfig +12 -0
  5. cachedir-0.1.1/.github/workflows/ci.yml +84 -0
  6. cachedir-0.1.1/.gitignore +216 -0
  7. cachedir-0.1.1/.pre-commit-config.yaml +108 -0
  8. cachedir-0.1.1/.readthedocs.yaml +22 -0
  9. cachedir-0.1.1/LICENSE +674 -0
  10. cachedir-0.1.1/PKG-INFO +231 -0
  11. cachedir-0.1.1/README.md +194 -0
  12. cachedir-0.1.1/cache_manager/__init__.py +9 -0
  13. cachedir-0.1.1/cache_manager/_cache.py +1776 -0
  14. cachedir-0.1.1/cache_manager/_data/__init__.py +4 -0
  15. cachedir-0.1.1/cache_manager/_data/main.yaml +13 -0
  16. cachedir-0.1.1/cache_manager/_freshness.py +187 -0
  17. cachedir-0.1.1/cache_manager/_item.py +536 -0
  18. cachedir-0.1.1/cache_manager/_lock.py +74 -0
  19. cachedir-0.1.1/cache_manager/_metadata.py +89 -0
  20. cachedir-0.1.1/cache_manager/_open.py +352 -0
  21. cachedir-0.1.1/cache_manager/_session.py +10 -0
  22. cachedir-0.1.1/cache_manager/_status.py +74 -0
  23. cachedir-0.1.1/cache_manager/utils.py +285 -0
  24. cachedir-0.1.1/docs/Makefile +20 -0
  25. cachedir-0.1.1/docs/make.bat +35 -0
  26. cachedir-0.1.1/docs/src/_cache.rst +5 -0
  27. cachedir-0.1.1/docs/src/_item.rst +5 -0
  28. cachedir-0.1.1/docs/src/_lock.rst +5 -0
  29. cachedir-0.1.1/docs/src/_open.rst +5 -0
  30. cachedir-0.1.1/docs/src/_static/css/style.css +15 -0
  31. cachedir-0.1.1/docs/src/_status.rst +5 -0
  32. cachedir-0.1.1/docs/src/conf.py +129 -0
  33. cachedir-0.1.1/docs/src/contents.rst +11 -0
  34. cachedir-0.1.1/docs/src/developer_docs.md +58 -0
  35. cachedir-0.1.1/docs/src/index.rst +31 -0
  36. cachedir-0.1.1/pyproject.toml +176 -0
  37. cachedir-0.1.1/scripts/hello_cache_manager.py +101 -0
  38. cachedir-0.1.1/tests/conftest.py +33 -0
  39. cachedir-0.1.1/tests/test_accessed.py +46 -0
  40. cachedir-0.1.1/tests/test_attr_namespaces.py +46 -0
  41. cachedir-0.1.1/tests/test_attr_search.py +146 -0
  42. cachedir-0.1.1/tests/test_attr_update.py +37 -0
  43. cachedir-0.1.1/tests/test_cache.py +215 -0
  44. cachedir-0.1.1/tests/test_clean.py +52 -0
  45. cachedir-0.1.1/tests/test_freshness.py +46 -0
  46. cachedir-0.1.1/tests/test_item.py +15 -0
  47. cachedir-0.1.1/tests/test_lock.py +25 -0
  48. cachedir-0.1.1/tests/test_open.py +179 -0
  49. cachedir-0.1.1/tests/test_remove.py +80 -0
  50. cachedir-0.1.1/tests/test_utils.py +21 -0
  51. cachedir-0.1.1/uv.lock +1597 -0
@@ -0,0 +1,8 @@
1
+ [bumpversion]
2
+ current_version = 0.1.1
3
+ commit = True
4
+ tag = True
5
+ files = pyproject.toml
6
+
7
+ parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
8
+ serialize = {major}.{minor}.{patch}
@@ -0,0 +1,17 @@
1
+ # Based on pydata/xarray
2
+ codecov:
3
+ require_ci_to_pass: no
4
+
5
+ coverage:
6
+ status:
7
+ project:
8
+ default:
9
+ # Require 1% coverage, i.e., always succeed
10
+ target: 1
11
+ patch: false
12
+ changes: false
13
+
14
+ comment:
15
+ layout: diff, flags, files
16
+ behavior: once
17
+ require_base: no
@@ -0,0 +1,22 @@
1
+ [paths]
2
+ source =
3
+ cache_manager
4
+ */site-packages/cache-manager
5
+
6
+ [run]
7
+ branch = true
8
+ parallel = true
9
+ source = cache_manager
10
+ omit = */__init__.py
11
+
12
+ [report]
13
+ exclude_lines =
14
+ \#.*pragma:\s*no.?cover
15
+
16
+ if __name__ == .__main__.
17
+
18
+ ^\s*raise AssertionError\b
19
+ ^\s*raise NotImplementedError\b
20
+ ^\s*return NotImplemented\b
21
+ show_missing = true
22
+ precision = 2
@@ -0,0 +1,12 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 4
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
11
+ [Makefile]
12
+ indent_style = tab
@@ -0,0 +1,84 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ types: [ opened, synchronize, reopened ]
8
+
9
+ jobs:
10
+ build:
11
+
12
+ runs-on: ${{ matrix.os }}
13
+ defaults:
14
+ run:
15
+ shell: bash -e {0}
16
+
17
+ strategy:
18
+ fail-fast: false
19
+ matrix:
20
+ python: ['3.9', '3.10', '3.11', '3.12']
21
+ os: [ubuntu-latest, macos-latest]
22
+
23
+ env:
24
+ OS: ${{ matrix.os }}
25
+ PYTHON: ${{ matrix.python }}
26
+ MODULE: cache_manager
27
+
28
+ steps:
29
+ - name: Check out main
30
+ uses: actions/checkout@v4
31
+ - name: Setup Python ${{ matrix.python }}
32
+ uses: actions/setup-python@v5
33
+ with:
34
+ python-version: ${{ matrix.python }}
35
+ - name: System dependencies Linux
36
+ if: ${{ matrix.os == 'ubuntu-latest' }}
37
+ run: |
38
+ sudo apt-get update
39
+ sudo apt-get install -y libcurl4-openssl-dev
40
+ - name: System dependencies OSX
41
+ if: ${{ matrix.os == 'macos-latest' }}
42
+ run: |
43
+ brew install openssl
44
+ export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
45
+ export CPPFLAGS="-I/usr/local/opt/openssl@3/include"
46
+ export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
47
+ - name: Install Poetry
48
+ uses: snok/install-poetry@v1
49
+ with:
50
+ version: 1.8.4
51
+ virtualenvs-create: true
52
+ virtualenvs-in-project: true
53
+ installer-parallel: true
54
+ - name: Load cached venv
55
+ id: cached-poetry-dependencies
56
+ uses: actions/cache@v4
57
+ with:
58
+ path: .venv
59
+ key: venv-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
60
+ - name: Install dependencies
61
+ if: ${{ steps.cached-poetry-dependencies.outputs.cache-hit != 'true' }}
62
+ run: poetry install --no-interaction --no-root
63
+ - name: Install library
64
+ run: poetry install --no-interaction
65
+ - name: Lint with flake8
66
+ run: |
67
+ # stop the build if there are Python syntax errors or undefined names
68
+ poetry run flake8 $MODULE --count --select=E9,F63,F7,F82 --show-source --statistics
69
+ # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
70
+ poetry run flake8 $MODULE --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
71
+ - name: Tests and test coverage
72
+ if: ${{ github.event_name == 'push' }}
73
+ run: |
74
+ poetry run pytest -v --cov --color=yes --durations=0 --disable-warnings
75
+ - name: Tests
76
+ if: ${{ github.event_name == 'pull_request' }}
77
+ run: |
78
+ poetry run pytest -v --color=yes --durations=0 --disable-warnings
79
+ - name: Upload coverage reports to Codecov
80
+ if: ${{ github.event_name == 'push' }}
81
+ env:
82
+ CODECOV_NAME: ${{ matrix.python }}-${{ matrix.os }}
83
+ run: |
84
+ poetry run codecovcli --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n 'std'-${{ github.run_id }}
@@ -0,0 +1,216 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+
204
+ # Ruff stuff:
205
+ .ruff_cache/
206
+
207
+ # PyPI configuration file
208
+ .pypirc
209
+
210
+ # Marimo
211
+ marimo/_static/
212
+ marimo/_lsp/
213
+ __marimo__/
214
+
215
+ # Streamlit
216
+ .streamlit/secrets.toml
@@ -0,0 +1,108 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ fail_fast: false
4
+ default_language_version:
5
+ python: python3
6
+ default_stages:
7
+ - commit
8
+ - push
9
+ minimum_pre_commit_version: 2.7.1
10
+ repos:
11
+ - repo: https://github.com/deeenes/unexport
12
+ rev: 0.4.0-patch0-3
13
+ hooks:
14
+ - id: unexport
15
+ args: [--refactor, --single_quotes]
16
+ exclude: __init__.py$
17
+ - repo: https://github.com/google/yapf
18
+ rev: v0.40.2
19
+ hooks:
20
+ - id: yapf
21
+ additional_dependencies: [toml]
22
+ stages: [manual]
23
+ - repo: https://github.com/psf/black
24
+ rev: 24.4.2
25
+ hooks:
26
+ - id: black
27
+ additional_dependencies: [toml]
28
+ stages: [manual]
29
+ - repo: https://github.com/Instagram/Fixit
30
+ rev: 9d59f968e84bd2773f34b0069eeeaad3ce783254
31
+ hooks:
32
+ - id: fixit-run-rules
33
+ stages: [manual]
34
+ - repo: https://github.com/timothycrosley/isort
35
+ rev: 5.13.2
36
+ hooks:
37
+ - id: isort
38
+ additional_dependencies: [toml]
39
+ - repo: https://github.com/snok/pep585-upgrade
40
+ rev: v1.0
41
+ hooks:
42
+ - id: upgrade-type-hints
43
+ args: [--futures=true]
44
+ - repo: https://github.com/asottile/add-trailing-comma
45
+ rev: v3.1.0
46
+ hooks:
47
+ - id: add-trailing-comma
48
+ - repo: https://github.com/myint/unify
49
+ rev: v0.5
50
+ hooks:
51
+ - id: unify
52
+ - repo: https://github.com/pre-commit/pre-commit-hooks
53
+ rev: v4.6.0
54
+ hooks:
55
+ - id: detect-private-key
56
+ - id: check-ast
57
+ - id: check-docstring-first
58
+ - id: end-of-file-fixer
59
+ - id: check-added-large-files
60
+ - id: mixed-line-ending
61
+ args: [--fix=lf]
62
+ exclude: ^docs/make.bat$
63
+ - id: trailing-whitespace
64
+ exclude: ^.bumpversion.cfg$
65
+ - id: check-merge-conflict
66
+ - id: check-case-conflict
67
+ - id: check-symlinks
68
+ - id: check-yaml
69
+ args: [--unsafe]
70
+ - id: check-ast
71
+ - id: fix-encoding-pragma
72
+ args: [--remove] # for Python3 codebase, it's not necessary
73
+ - id: requirements-txt-fixer
74
+ - repo: https://github.com/john-hen/Flake8-pyproject
75
+ rev: 1.2.3
76
+ hooks:
77
+ - id: Flake8-pyproject
78
+ additional_dependencies: [flake8-docstrings, flake8-comprehensions, flake8-bugbear]
79
+ args:
80
+ - --per-file-ignores=tests/*:D100,D101,D102,D103,F401
81
+ - repo: https://github.com/rstcheck/rstcheck
82
+ rev: v6.2.0
83
+ hooks:
84
+ - id: rstcheck
85
+ exclude: docs
86
+ - repo: https://github.com/asottile/blacken-docs
87
+ rev: 1.16.0
88
+ hooks:
89
+ - id: blacken-docs
90
+ - repo: https://github.com/asottile/pyupgrade
91
+ rev: v3.15.2
92
+ hooks:
93
+ - id: pyupgrade
94
+ args: [--py3-plus, --py38-plus, --keep-runtime-typing]
95
+ - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
96
+ rev: v2.13.0
97
+ hooks:
98
+ - id: pretty-format-yaml
99
+ args: [--autofix, --indent, '4']
100
+ - repo: https://github.com/pre-commit/pygrep-hooks
101
+ rev: v1.10.0
102
+ hooks:
103
+ - id: python-no-eval
104
+ - id: python-use-type-annotations
105
+ - id: python-check-blanket-noqa
106
+ - id: rst-backticks
107
+ - id: rst-directive-colons
108
+ - id: rst-inline-touching-normal
@@ -0,0 +1,22 @@
1
+ version: 2
2
+
3
+ sphinx:
4
+ builder: html
5
+ configuration: docs/source/conf.py
6
+ fail_on_warning: true
7
+
8
+ formats:
9
+ - htmlzip
10
+ - pdf
11
+
12
+ build:
13
+ os: ubuntu-22.04
14
+ tools:
15
+ python: 3.10
16
+
17
+ python:
18
+ install:
19
+ - method: pip
20
+ path: .
21
+ extra_requirements:
22
+ - docs