| 1 |
[project] |
| 2 |
name = "cachelib" |
| 3 |
version = "0.17.0" |
| 4 |
description = "A collection of cache libraries in the same API interface." |
| 5 |
readme = "README.md" |
| 6 |
license = "BSD-3-Clause" |
| 7 |
license-files = ["LICENSE.txt"] |
| 8 |
maintainers = [{ name = "Pallets Ecosystem", email = "[email protected]" }] |
| 9 |
classifiers = [ |
| 10 |
"Development Status :: 5 - Production/Stable", |
| 11 |
"Intended Audience :: Developers", |
| 12 |
"Operating System :: OS Independent", |
| 13 |
"Programming Language :: Python", |
| 14 |
"Typing :: Typed", |
| 15 |
] |
| 16 |
requires-python = ">=3.11" |
| 17 |
|
| 18 |
[project.urls] |
| 19 |
Donate = "https://palletsprojects.com/donate" |
| 20 |
Documentation = "https://cachelib.readthedocs.io" |
| 21 |
Changes = "https://cachelib.readthedocs.io/page/changes/" |
| 22 |
Source = "https://github.com/pallets-eco/cachelib/" |
| 23 |
Chat = "https://discord.gg/pallets" |
| 24 |
|
| 25 |
[project.optional-dependencies] |
| 26 |
dynamodb = [ |
| 27 |
"boto3>=1.43.4", |
| 28 |
] |
| 29 |
memcached = [ |
| 30 |
"pylibmc>=1.6.3", |
| 31 |
] |
| 32 |
mongodb = [ |
| 33 |
"pymongo>=4.11", |
| 34 |
] |
| 35 |
redis = [ |
| 36 |
"redis>=6.0.0", |
| 37 |
] |
| 38 |
valkey = [ |
| 39 |
"valkey>=6.1.0", |
| 40 |
] |
| 41 |
uwsgi = [ |
| 42 |
"uwsgi>=2.0.28", |
| 43 |
] |
| 44 |
|
| 45 |
[dependency-groups] |
| 46 |
dev = [ |
| 47 |
"ruff", |
| 48 |
"tox", |
| 49 |
"tox-uv", |
| 50 |
] |
| 51 |
docs = [ |
| 52 |
"sphinx", |
| 53 |
# Theme |
| 54 |
"pallets-sphinx-themes", |
| 55 |
# Extensions |
| 56 |
"sphinxcontrib-log-cabinet", |
| 57 |
"sphinx-tabs", |
| 58 |
"sphinx_copybutton", |
| 59 |
# Check Spelling |
| 60 |
"pyenchant", |
| 61 |
"sphinxcontrib-spelling", |
| 62 |
] |
| 63 |
docs-auto = [ |
| 64 |
"sphinx-autobuild", |
| 65 |
] |
| 66 |
gha-update = [ |
| 67 |
"gha-update ; python_full_version >= '3.12'", |
| 68 |
] |
| 69 |
pre-commit = [ |
| 70 |
"pre-commit", |
| 71 |
"pre-commit-uv", |
| 72 |
] |
| 73 |
tests = [ |
| 74 |
"boto3>=1.43.4", |
| 75 |
"pylibmc>=1.6.3", |
| 76 |
"python-memcached>=1.62", |
| 77 |
"pymongo>=4.11", |
| 78 |
"pytest", |
| 79 |
"pytest-xprocess", |
| 80 |
"redis>=6.0.0", |
| 81 |
"valkey>=6.1.0", |
| 82 |
"uwsgi>=2.0.28", |
| 83 |
] |
| 84 |
typing = [ |
| 85 |
"mypy", |
| 86 |
"pyright", |
| 87 |
"boto3-stubs[dynamodb]", |
| 88 |
] |
| 89 |
|
| 90 |
[build-system] |
| 91 |
requires = ["flit_core<4"] |
| 92 |
build-backend = "flit_core.buildapi" |
| 93 |
|
| 94 |
[tool.flit.sdist] |
| 95 |
include = [ |
| 96 |
"docs/", |
| 97 |
"tests/", |
| 98 |
"CHANGES.rst", |
| 99 |
"uv.lock" |
| 100 |
] |
| 101 |
exclude = [ |
| 102 |
"docs/_build/", |
| 103 |
] |
| 104 |
|
| 105 |
[tool.uv] |
| 106 |
default-groups = ["dev", "pre-commit", "tests", "typing"] |
| 107 |
|
| 108 |
[tool.pytest.ini_options] |
| 109 |
addopts = "--strict-markers" |
| 110 |
testpaths = ["tests"] |
| 111 |
filterwarnings = [ |
| 112 |
"error", |
| 113 |
"default::pytest.PytestUnraisableExceptionWarning", # pylibmc C ext on py3.13+ |
| 114 |
] |
| 115 |
markers = [ |
| 116 |
"network: mark a test which requires net access (deselect with '-m \"not network\"')", |
| 117 |
] |
| 118 |
|
| 119 |
[tool.coverage.run] |
| 120 |
branch = true |
| 121 |
source = ["cachelib", "tests"] |
| 122 |
|
| 123 |
[tool.coverage.paths] |
| 124 |
source = ["src", "*/site-packages"] |
| 125 |
|
| 126 |
[tool.coverage.report] |
| 127 |
exclude_also = [ |
| 128 |
"if t.TYPE_CHECKING", |
| 129 |
"raise NotImplementedError", |
| 130 |
": \\.{3}", |
| 131 |
] |
| 132 |
|
| 133 |
[tool.mypy] |
| 134 |
python_version = "3.11" |
| 135 |
files = ["src"] |
| 136 |
show_error_codes = true |
| 137 |
pretty = true |
| 138 |
strict = true |
| 139 |
|
| 140 |
[tool.pyright] |
| 141 |
pythonVersion = "3.11" |
| 142 |
include = ["src"] |
| 143 |
typeCheckingMode = "standard" |
| 144 |
|
| 145 |
[tool.ruff] |
| 146 |
src = ["src"] |
| 147 |
fix = true |
| 148 |
show-fixes = true |
| 149 |
output-format = "full" |
| 150 |
|
| 151 |
[tool.ruff.lint] |
| 152 |
select = [ |
| 153 |
"B", # flake8-bugbear |
| 154 |
"E", # pycodestyle error |
| 155 |
"F", # pyflakes |
| 156 |
"I", # isort |
| 157 |
"UP", # pyupgrade |
| 158 |
"W", # pycodestyle warning |
| 159 |
] |
| 160 |
|
| 161 |
[tool.ruff.lint.isort] |
| 162 |
force-single-line = true |
| 163 |
order-by-type = false |
| 164 |
|
| 165 |
[tool.tox] |
| 166 |
env_list = [ |
| 167 |
"py3.15", "py3.14", "py3.13", "py3.12", "py3.11", |
| 168 |
"style", |
| 169 |
"typing", |
| 170 |
"docs", |
| 171 |
] |
| 172 |
|
| 173 |
[tool.tox.env_run_base] |
| 174 |
description = "pytest on latest dependency versions" |
| 175 |
runner = "uv-venv-lock-runner" |
| 176 |
package = "wheel" |
| 177 |
wheel_build_env = ".pkg" |
| 178 |
constrain_package_deps = true |
| 179 |
use_frozen_constraints = true |
| 180 |
dependency_groups = ["tests"] |
| 181 |
pass_env = ["CI"] |
| 182 |
set_env = { TMPDIR = "{env_tmp_dir}" } |
| 183 |
commands = [ |
| 184 |
[ |
| 185 |
"pytest", "-v", "-rs", "--tb=short", |
| 186 |
"--capture=tee-sys", "--basetemp={env_tmp_dir}", |
| 187 |
{ replace = "posargs", default = [], extend = true }, |
| 188 |
], |
| 189 |
[ |
| 190 |
"uwsgi", "--python", "{env_bin_dir}/pytest", "--pyargv", |
| 191 |
"-v -rs --tb=short --capture=tee-sys --basetemp={env_tmp_dir} {posargs} -kUwsgi", |
| 192 |
"--cache2", "name=default,items=100", "--master", |
| 193 |
], |
| 194 |
["python", "{envtmpdir}/return_pytest_exit_code.py"], |
| 195 |
] |
| 196 |
|
| 197 |
[tool.tox.env.style] |
| 198 |
description = "run all pre-commit hooks on all files" |
| 199 |
dependency_groups = ["pre-commit"] |
| 200 |
skip_install = true |
| 201 |
commands = [["pre-commit", "run", "--all-files"]] |
| 202 |
|
| 203 |
[tool.tox.env.typing] |
| 204 |
description = "run static type checkers" |
| 205 |
dependency_groups = ["tests", "typing"] |
| 206 |
commands = [ |
| 207 |
["mypy"], |
| 208 |
] |
| 209 |
|
| 210 |
[tool.tox.docs] |
| 211 |
docs_dir = "{tox_root}{/}docs" |
| 212 |
build_dir = "{[tool.tox.docs]docs_dir}{/}_build" |
| 213 |
sphinx_args = ["--show-traceback", "--fail-on-warning", "--keep-going", "--fresh-env"] |
| 214 |
|
| 215 |
[tool.tox.env.docs] |
| 216 |
description = "build docs" |
| 217 |
dependency_groups = ["docs"] |
| 218 |
commands = [[ |
| 219 |
"sphinx-build", |
| 220 |
{ replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, |
| 221 |
{ replace = "posargs", default = [], extend = true }, |
| 222 |
"--builder", "dirhtml", |
| 223 |
"{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}dirhtml", |
| 224 |
]] |
| 225 |
|
| 226 |
[tool.tox.env.docs-auto] |
| 227 |
description = "continuously rebuild docs and start a local server" |
| 228 |
dependency_groups = ["docs", "docs-auto"] |
| 229 |
package = "editable" |
| 230 |
commands = [[ |
| 231 |
"sphinx-autobuild", |
| 232 |
{ replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, |
| 233 |
{ replace = "posargs", default = [], extend = true }, |
| 234 |
"--builder", "dirhtml", "--watch", "src", |
| 235 |
"{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}live", |
| 236 |
]] |
| 237 |
|
| 238 |
[tool.tox.env.docs-lint] |
| 239 |
description = "check docs spelling and links" |
| 240 |
dependency_groups = ["docs"] |
| 241 |
commands = [ |
| 242 |
[ |
| 243 |
"sphinx-build", |
| 244 |
{ replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, |
| 245 |
{ replace = "posargs", default = [], extend = true }, |
| 246 |
"--builder", "spelling", |
| 247 |
"{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}spell", |
| 248 |
], |
| 249 |
[ |
| 250 |
"sphinx-build", |
| 251 |
{ replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true }, |
| 252 |
{ replace = "posargs", default = [], extend = true }, |
| 253 |
"--builder", "linkcheck", |
| 254 |
"{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}links", |
| 255 |
], |
| 256 |
] |
| 257 |
|
| 258 |
[tool.tox.env.update-actions] |
| 259 |
description = "update GitHub Actions pins" |
| 260 |
labels = ["update"] |
| 261 |
dependency_groups = ["gha-update"] |
| 262 |
skip_install = true |
| 263 |
commands = [["gha-update"]] |
| 264 |
|
| 265 |
[tool.tox.env.update-pre_commit] |
| 266 |
description = "update pre-commit pins" |
| 267 |
labels = ["update"] |
| 268 |
dependency_groups = ["pre-commit"] |
| 269 |
skip_install = true |
| 270 |
commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]] |
| 271 |
|
| 272 |
[tool.tox.env.update-requirements] |
| 273 |
description = "update uv lock" |
| 274 |
labels = ["update"] |
| 275 |
dependency_groups = [] |
| 276 |
no_default_groups = true |
| 277 |
skip_install = true |
| 278 |
commands = [["uv", "lock", "--exclude-newer", "1 week", {replace = "posargs", default = ["-U"], extend = true}]] |