| 1 |
[project] |
| 2 |
name = "Flask-Caching" |
| 3 |
version = "2.4.1" |
| 4 |
description = "Adds caching support to Flask applications." |
| 5 |
readme = "README.md" |
| 6 |
license = "BSD-3-Clause" |
| 7 |
license-files = ["LICENSE"] |
| 8 |
authors = [{ name = "Peter Justin", email="[email protected]" }] |
| 9 |
maintainers = [{ name = "Pallets Ecosystem", email = "[email protected]" }] |
| 10 |
classifiers = [ |
| 11 |
'Development Status :: 5 - Production/Stable', |
| 12 |
'Environment :: Web Environment', |
| 13 |
'Intended Audience :: Developers', |
| 14 |
'Operating System :: OS Independent', |
| 15 |
'Programming Language :: Python', |
| 16 |
] |
| 17 |
requires-python = ">=3.10" |
| 18 |
dependencies = [ |
| 19 |
"flask>=2.0", |
| 20 |
"cachelib>=0.9.0", |
| 21 |
] |
| 22 |
|
| 23 |
[project.urls] |
| 24 |
Documentation = "https://flask-caching.readthedocs.io" |
| 25 |
Changes = "https://github.com/pallets-eco/flask-caching/releases/" |
| 26 |
Source = "https://github.com/pallets-eco/flask-caching" |
| 27 |
Chat = "https://discord.gg/pallets" |
| 28 |
|
| 29 |
[dependency-groups] |
| 30 |
dev = [ |
| 31 |
"ruff", |
| 32 |
"tox>=4.39", |
| 33 |
"tox-uv", |
| 34 |
{include-group = "pre-commit"}, |
| 35 |
{include-group = "docs"}, |
| 36 |
{include-group = "tests"}, |
| 37 |
{include-group = "typing"}, |
| 38 |
] |
| 39 |
pre-commit = [ |
| 40 |
"pre-commit", |
| 41 |
"pre-commit-uv", |
| 42 |
] |
| 43 |
docs = [ |
| 44 |
"pallets-sphinx-themes", |
| 45 |
"sphinx", |
| 46 |
"sphinx-issues", |
| 47 |
"sphinx-tabs", |
| 48 |
"sphinx-intl>=2.3.1", |
| 49 |
"sphinxcontrib-log-cabinet", |
| 50 |
] |
| 51 |
tests = [ |
| 52 |
"flask[async]", |
| 53 |
"pytest", |
| 54 |
"pytest-cov", |
| 55 |
"pytest-asyncio", |
| 56 |
"pytest-xprocess", |
| 57 |
"libmc", |
| 58 |
"redis", |
| 59 |
"asgiref", |
| 60 |
] |
| 61 |
typing = [ |
| 62 |
"mypy", |
| 63 |
"pyright", |
| 64 |
"pytest", |
| 65 |
"types-redis>=4.6.0.20241004", |
| 66 |
"types-uwsgi>=2.0.0.20260408", |
| 67 |
] |
| 68 |
gha-update = [ |
| 69 |
"gha-update ; python_full_version >= '3.12'", |
| 70 |
] |
| 71 |
|
| 72 |
[build-system] |
| 73 |
requires = ["flit_core>=3.11,<4"] |
| 74 |
build-backend = "flit_core.buildapi" |
| 75 |
|
| 76 |
[tool.flit.module] |
| 77 |
name = "flask_caching" |
| 78 |
|
| 79 |
[tool.flit.sdist] |
| 80 |
include = [ |
| 81 |
"docs/", |
| 82 |
"examples/", |
| 83 |
"tests/", |
| 84 |
"CHANGES.rst", |
| 85 |
"uv.lock" |
| 86 |
] |
| 87 |
exclude = [ |
| 88 |
"docs/_build/", |
| 89 |
] |
| 90 |
|
| 91 |
[tool.uv] |
| 92 |
default-groups = ["dev", "pre-commit", "tests", "typing"] |
| 93 |
|
| 94 |
[tool.ruff] |
| 95 |
src = ["src"] |
| 96 |
fix = true |
| 97 |
show-fixes = true |
| 98 |
output-format = "full" |
| 99 |
|
| 100 |
[tool.ruff.lint] |
| 101 |
select = [ |
| 102 |
"B", # flake8-bugbear |
| 103 |
"E", # pycodestyle error |
| 104 |
"F", # pyflakes |
| 105 |
"I", # isort |
| 106 |
"UP", # pyupgrade |
| 107 |
"W", # pycodestyle warning |
| 108 |
] |
| 109 |
ignore = [ |
| 110 |
"UP007", # Use X | Y for type annotations; doesn't work with some of our (stringy) type definitions - should aim to resolve this |
| 111 |
] |
| 112 |
|
| 113 |
[tool.ruff.lint.isort] |
| 114 |
force-single-line = true |
| 115 |
order-by-type = false |
| 116 |
|
| 117 |
[tool.coverage.run] |
| 118 |
branch = true |
| 119 |
source = ["flask_caching", "tests"] |
| 120 |
omit = ["src/flask_caching/contrib/*"] |
| 121 |
|
| 122 |
[tool.coverage.paths] |
| 123 |
source = ["src", "*/site-packages"] |
| 124 |
|
| 125 |
[tool.coverage.report] |
| 126 |
exclude_also = [ |
| 127 |
"if t.TYPE_CHECKING", |
| 128 |
"raise NotImplementedError", |
| 129 |
": \\.{3}", |
| 130 |
] |
| 131 |
|
| 132 |
[tool.pytest.ini_options] |
| 133 |
testpaths = ["tests"] |
| 134 |
filterwarnings = [ |
| 135 |
"error", |
| 136 |
"default::pytest.PytestUnraisableExceptionWarning", |
| 137 |
] |
| 138 |
|
| 139 |
[tool.mypy] |
| 140 |
python_version = "3.10" |
| 141 |
files = ["src/flask_caching/"] |
| 142 |
warn_unused_configs = true |
| 143 |
|
| 144 |
# TODO if all of these can be enabled we can just set 'strict = true' |
| 145 |
disallow_subclassing_any = true |
| 146 |
# disallow_untyped_calls = true |
| 147 |
# disallow_untyped_defs = true |
| 148 |
# disallow_incomplete_defs = true |
| 149 |
# check_untyped_defs = true |
| 150 |
disallow_untyped_decorators = true |
| 151 |
no_implicit_optional = true |
| 152 |
warn_redundant_casts = true |
| 153 |
warn_unused_ignores = true |
| 154 |
# warn_return_any = true |
| 155 |
# no_implicit_reexport = true |
| 156 |
strict_equality = true |
| 157 |
strict_concatenate = true |
| 158 |
|
| 159 |
[[tool.mypy.overrides]] |
| 160 |
module = [ |
| 161 |
"pylibmc", |
| 162 |
"google.*", |
| 163 |
] |
| 164 |
ignore_missing_imports = true |
| 165 |
|
| 166 |
[tool.pyright] |
| 167 |
pythonVersion = "3.10" |
| 168 |
include = ["src"] |
| 169 |
typeCheckingMode = "basic" |
| 170 |
|
| 171 |
|
| 172 |
[tool.tox] |
| 173 |
env_list = [ |
| 174 |
"py3.14", |
| 175 |
"py3.13", "py3.12", "py3.11", "py3.10", |
| 176 |
"style", |
| 177 |
"typing", |
| 178 |
"docs", |
| 179 |
] |
| 180 |
|
| 181 |
[tool.tox.env_run_base] |
| 182 |
description = "pytest on latest dependency versions" |
| 183 |
runner = "uv-venv-lock-runner" |
| 184 |
package = "wheel" |
| 185 |
wheel_build_env = ".pkg" |
| 186 |
constrain_package_deps = true |
| 187 |
use_frozen_constraints = true |
| 188 |
dependency_groups = ["tests"] |
| 189 |
env_tmp_dir = "{toxworkdir}/tmp/{envname}" |
| 190 |
commands = [[ |
| 191 |
"pytest", "-v", "--capture=tee-sys", "--tb=short", "--basetemp={env_tmp_dir}", |
| 192 |
{replace = "posargs", default = [], extend = true}, |
| 193 |
]] |
| 194 |
|
| 195 |
[tool.tox.env.style] |
| 196 |
description = "run all pre-commit hooks on all files" |
| 197 |
dependency_groups = ["pre-commit"] |
| 198 |
skip_install = true |
| 199 |
commands = [["pre-commit", "run", "--all-files"]] |
| 200 |
|
| 201 |
[tool.tox.env.typing] |
| 202 |
description = "run static type checkers" |
| 203 |
dependency_groups = ["typing"] |
| 204 |
commands = [ |
| 205 |
["mypy"], |
| 206 |
] |
| 207 |
|
| 208 |
[tool.tox.env.docs] |
| 209 |
description = "build docs" |
| 210 |
dependency_groups = ["docs"] |
| 211 |
commands = [["sphinx-build", "-E", "-W", "-b", "html", "docs", "docs/_build/"]] |
| 212 |
|
| 213 |
[tool.tox.env.update-actions] |
| 214 |
description = "update GitHub Actions pins" |
| 215 |
labels = ["update"] |
| 216 |
dependency_groups = ["gha-update"] |
| 217 |
skip_install = true |
| 218 |
commands = [["gha-update"]] |
| 219 |
|
| 220 |
[tool.tox.env.update-pre_commit] |
| 221 |
description = "update pre-commit pins" |
| 222 |
labels = ["update"] |
| 223 |
dependency_groups = ["pre-commit"] |
| 224 |
skip_install = true |
| 225 |
commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]] |
| 226 |
|
| 227 |
[tool.tox.env.update-requirements] |
| 228 |
description = "update uv lock" |
| 229 |
labels = ["update"] |
| 230 |
dependency_groups = [] |
| 231 |
no_default_groups = true |
| 232 |
skip_install = true |
| 233 |
commands = [["uv", "lock", {replace = "posargs", default = ["-U"], extend = true}]] |