Debian Codegraph @

pyproject.toml

raw
1 [project]
2 name = "Flask-Caching"
3 version = "2.5.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.11"
18 dependencies = [
19 "flask>=3.0",
20 "cachelib>=0.17.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 {include-group = "tox"},
33 {include-group = "pre-commit"},
34 {include-group = "docs"},
35 {include-group = "tests"},
36 {include-group = "typing"},
37 ]
38 tox = [
39 "tox>=4.39",
40 "tox-uv",
41 ]
42 pre-commit = [
43 "pre-commit",
44 "pre-commit-uv",
45 ]
46 docs = [
47 "pallets-sphinx-themes",
48 "sphinx",
49 "sphinx-issues",
50 "sphinx-tabs",
51 "sphinx-intl>=2.3.1",
52 "sphinxcontrib-log-cabinet",
53 ]
54 docs-auto = [
55 "sphinx-autobuild",
56 ]
57 tests = [
58 "flask[async]",
59 "pytest",
60 "pytest-cov",
61 "pytest-asyncio",
62 "pytest-xprocess",
63 "pylibmc",
64 "redis",
65 "asgiref",
66 ]
67 typing = [
68 "mypy",
69 "pyright",
70 "pytest",
71 "types-redis>=4.6.0.20241004",
72 "types-uwsgi>=2.0.0.20260408",
73 ]
74 gha-update = [
75 "gha-update ; python_full_version >= '3.12'",
76 ]
77
78 [build-system]
79 requires = ["flit_core>=3.11,<5"]
80 build-backend = "flit_core.buildapi"
81
82 [tool.flit.module]
83 name = "flask_caching"
84
85 [tool.flit.sdist]
86 include = [
87 "docs/",
88 "examples/",
89 "tests/",
90 "CHANGES.rst",
91 "uv.lock"
92 ]
93 exclude = [
94 "docs/_build/",
95 ]
96
97 [tool.uv]
98 default-groups = ["dev", "pre-commit", "tests", "typing"]
99
100 [tool.ruff]
101 src = ["src"]
102 fix = true
103 show-fixes = true
104 output-format = "full"
105
106 [tool.ruff.lint]
107 select = [
108 "B", # flake8-bugbear
109 "E", # pycodestyle error
110 "F", # pyflakes
111 "I", # isort
112 "UP", # pyupgrade
113 "W", # pycodestyle warning
114 ]
115 ignore = [
116 "UP007", # Use X | Y for type annotations; doesn't work with some of our (stringy) type definitions - should aim to resolve this
117 ]
118
119 [tool.ruff.lint.isort]
120 force-single-line = true
121 order-by-type = false
122
123 [tool.coverage.run]
124 branch = true
125 source = ["flask_caching", "tests"]
126 omit = ["src/flask_caching/contrib/*"]
127
128 [tool.coverage.paths]
129 source = ["src", "*/site-packages"]
130
131 [tool.coverage.report]
132 exclude_also = [
133 "if t.TYPE_CHECKING",
134 "raise NotImplementedError",
135 ": \\.{3}",
136 ]
137
138 [tool.pytest.ini_options]
139 testpaths = ["tests"]
140 filterwarnings = [
141 "error",
142 "default::pytest.PytestUnraisableExceptionWarning",
143 ]
144
145 [tool.mypy]
146 python_version = "3.11"
147 files = ["src/flask_caching/", "tests/typing/"]
148 warn_unused_configs = true
149 strict = true
150
151 [[tool.mypy.overrides]]
152 module = [
153 "pylibmc",
154 "google.*",
155 ]
156 ignore_missing_imports = true
157
158 [tool.pyright]
159 pythonVersion = "3.11"
160 include = ["src", "tests/typing"]
161 typeCheckingMode = "standard"
162
163
164 [tool.tox]
165 env_list = [
166 "py3.14", "py3.13", "py3.12", "py3.11",
167 "style",
168 "typing",
169 "docs",
170 "docs-auto",
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 env_tmp_dir = "{toxworkdir}/tmp/{envname}"
183 commands = [[
184 "pytest", "-v", "--capture=tee-sys", "--tb=short", "--basetemp={env_tmp_dir}",
185 {replace = "posargs", default = [], extend = true},
186 ]]
187
188 [tool.tox.env.style]
189 description = "run all pre-commit hooks on all files"
190 dependency_groups = ["pre-commit"]
191 skip_install = true
192 commands = [["pre-commit", "run", "--all-files"]]
193
194 [tool.tox.env.typing]
195 description = "run static type checkers"
196 dependency_groups = ["typing"]
197 commands = [
198 ["mypy"],
199 ]
200
201 [tool.tox.docs]
202 docs_dir = "{tox_root}{/}docs"
203 build_dir = "{[tool.tox.docs]docs_dir}{/}_build"
204 sphinx_args = ["--show-traceback", "--fail-on-warning", "--keep-going", "--fresh-env"]
205
206 [tool.tox.env.docs]
207 description = "build docs"
208 dependency_groups = ["docs"]
209 commands = [[
210 "sphinx-build",
211 { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true },
212 { replace = "posargs", default = [], extend = true },
213 "--builder", "dirhtml",
214 "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}dirhtml",
215 ]]
216
217 [tool.tox.env.docs-auto]
218 description = "continuously rebuild docs and start a local server"
219 dependency_groups = ["docs", "docs-auto"]
220 package = "editable"
221 commands = [[
222 "sphinx-autobuild",
223 { replace = "ref", of = ["tool", "tox", "docs", "sphinx_args"], extend = true },
224 { replace = "posargs", default = [], extend = true },
225 "--builder", "dirhtml", "--watch", "src",
226 "{[tool.tox.docs]docs_dir}", "{[tool.tox.docs]build_dir}{/}live",
227 ]]
228
229 [tool.tox.env.update-actions]
230 description = "update GitHub Actions pins"
231 labels = ["update"]
232 dependency_groups = ["gha-update"]
233 skip_install = true
234 commands = [["gha-update"]]
235
236 [tool.tox.env.update-pre_commit]
237 description = "update pre-commit pins"
238 labels = ["update"]
239 dependency_groups = ["pre-commit"]
240 skip_install = true
241 commands = [["pre-commit", "autoupdate", "--freeze", "-j4"]]
242
243 [tool.tox.env.update-requirements]
244 description = "update uv lock"
245 labels = ["update"]
246 dependency_groups = []
247 no_default_groups = true
248 skip_install = true
249 commands = [["uv", "lock", {replace = "posargs", default = ["-U"], extend = true}]]