@@ -21,10 +21,42 @@ dependencies = [
2121[project .urls ]
2222Donate = " https://palletsprojects.com/donate"
2323Documentation = " https://click.palletsprojects.com/"
24- Changes = " https://click.palletsprojects.com/changes/"
24+ Changes = " https://click.palletsprojects.com/page/ changes/"
2525Source = " https://github.com/pallets/click/"
2626Chat = " https://discord.gg/pallets"
2727
28+ [dependency-groups ]
29+ dev = [
30+ " ruff" ,
31+ " tox" ,
32+ " tox-uv" ,
33+ ]
34+ docs = [
35+ " myst-parser" ,
36+ " pallets-sphinx-themes" ,
37+ " sphinx" ,
38+ " sphinx-tabs" ,
39+ " sphinxcontrib-log-cabinet" ,
40+ ]
41+ docs-auto = [
42+ " sphinx-autobuild" ,
43+ ]
44+ gha-update = [
45+ " gha-update ; python_full_version >= '3.12'" ,
46+ ]
47+ pre-commit = [
48+ " pre-commit" ,
49+ " pre-commit-uv" ,
50+ ]
51+ tests = [
52+ " pytest" ,
53+ ]
54+ typing = [
55+ " mypy" ,
56+ " pyright" ,
57+ " pytest" ,
58+ ]
59+
2860[build-system ]
2961requires = [" flit_core<4" ]
3062build-backend = " flit_core.buildapi"
@@ -35,15 +67,17 @@ name = "click"
3567[tool .flit .sdist ]
3668include = [
3769 " docs/" ,
38- " requirements/" ,
3970 " tests/" ,
4071 " CHANGES.rst" ,
41- " tox.ini " ,
72+ " uv.lock "
4273]
4374exclude = [
4475 " docs/_build/" ,
4576]
4677
78+ [tool .uv ]
79+ default-groups = [" dev" , " pre-commit" , " tests" , " typing" ]
80+
4781[tool .pytest .ini_options ]
4882testpaths = [" tests" ]
4983filterwarnings = [
@@ -57,9 +91,16 @@ source = ["click", "tests"]
5791[tool .coverage .paths ]
5892source = [" src" , " */site-packages" ]
5993
94+ [tool .coverage .report ]
95+ exclude_also = [
96+ " if t.TYPE_CHECKING" ,
97+ " raise NotImplementedError" ,
98+ " : \\ .{3}" ,
99+ ]
100+
60101[tool .mypy ]
61102python_version = " 3.10"
62- files = [" src/click " , " tests/typing" ]
103+ files = [" src" , " tests/typing" ]
63104show_error_codes = true
64105pretty = true
65106strict = true
@@ -72,7 +113,7 @@ ignore_missing_imports = true
72113
73114[tool .pyright ]
74115pythonVersion = " 3.10"
75- include = [" src/click " , " tests/typing" ]
116+ include = [" src" , " tests/typing" ]
76117typeCheckingMode = " basic"
77118
78119[tool .ruff ]
@@ -92,7 +133,7 @@ select = [
92133 " W" , # pycodestyle warning
93134]
94135ignore = [
95- " UP038" , # keep isinstance tuples
136+ " UP038" , # keep isinstance tuple
96137]
97138
98139[tool .ruff .lint .isort ]
@@ -103,3 +144,70 @@ order-by-type = false
103144tag-only = [
104145 " slsa-framework/slsa-github-generator" ,
105146]
147+
148+ [tool .tox ]
149+ env_list = [
150+ " py3.13" , " py3.12" , " py3.11" , " py3.10" ,
151+ " pypy3.11" ,
152+ " style" ,
153+ " typing" ,
154+ " docs" ,
155+ ]
156+
157+ [tool .tox .env_run_base ]
158+ description = " pytest on latest dependency versions"
159+ runner = " uv-venv-lock-runner"
160+ package = " wheel"
161+ wheel_build_env = " .pkg"
162+ constrain_package_deps = true
163+ use_frozen_constraints = true
164+ dependency_groups = [" tests" ]
165+ commands = [[
166+ " pytest" , " -v" , " --tb=short" , " --basetemp={env_tmp_dir}" ,
167+ {replace = " posargs" , default = [], extend = true },
168+ ]]
169+
170+ [tool .tox .env .style ]
171+ description = " run all pre-commit hooks on all files"
172+ dependency_groups = [" pre-commit" ]
173+ skip_install = true
174+ commands = [[" pre-commit" , " run" , " --all-files" ]]
175+
176+ [tool .tox .env .typing ]
177+ description = " run static type checkers"
178+ dependency_groups = [" typing" ]
179+ commands = [
180+ [" mypy" ],
181+ ]
182+
183+ [tool .tox .env .docs ]
184+ description = " build docs"
185+ dependency_groups = [" docs" ]
186+ commands = [[" sphinx-build" , " -E" , " -W" , " -b" , " dirhtml" , " docs" , " docs/_build/dirhtml" ]]
187+
188+ [tool .tox .env .docs-auto ]
189+ description = " continuously rebuild docs and start a local server"
190+ dependency_groups = [" docs" , " docs-auto" ]
191+ commands = [[" sphinx-autobuild" , " -W" , " -b" , " dirhtml" , " --watch" , " src" , " docs" , " docs/_build/dirhtml" ]]
192+
193+ [tool .tox .env .update-actions ]
194+ description = " update GitHub Actions pins"
195+ labels = [" update" ]
196+ dependency_groups = [" gha-update" ]
197+ skip_install = true
198+ commands = [[" gha-update" ]]
199+
200+ [tool .tox .env .update-pre_commit ]
201+ description = " update pre-commit pins"
202+ labels = [" update" ]
203+ dependency_groups = [" pre-commit" ]
204+ skip_install = true
205+ commands = [[" pre-commit" , " autoupdate" , " --freeze" , " -j4" ]]
206+
207+ [tool .tox .env .update-requirements ]
208+ description = " update uv lock"
209+ labels = [" update" ]
210+ dependency_groups = []
211+ no_default_groups = true
212+ skip_install = true
213+ commands = [[" uv" , " lock" , {replace = " posargs" , default = [" -U" ], extend = true }]]
0 commit comments