@@ -21,10 +21,41 @@ 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+ " sphinxcontrib-log-cabinet" ,
39+ ]
40+ docs-auto = [
41+ " sphinx-autobuild" ,
42+ ]
43+ gha-update = [
44+ " gha-update ; python_full_version >= '3.12'" ,
45+ ]
46+ pre-commit = [
47+ " pre-commit" ,
48+ " pre-commit-uv" ,
49+ ]
50+ tests = [
51+ " pytest" ,
52+ ]
53+ typing = [
54+ " mypy" ,
55+ " pyright" ,
56+ " pytest" ,
57+ ]
58+
2859[build-system ]
2960requires = [" flit_core<4" ]
3061build-backend = " flit_core.buildapi"
@@ -35,15 +66,17 @@ name = "click"
3566[tool .flit .sdist ]
3667include = [
3768 " docs/" ,
38- " requirements/" ,
3969 " tests/" ,
4070 " CHANGES.rst" ,
41- " tox.ini " ,
71+ " uv.lock "
4272]
4373exclude = [
4474 " docs/_build/" ,
4575]
4676
77+ [tool .uv ]
78+ default-groups = [" dev" , " pre-commit" , " tests" , " typing" ]
79+
4780[tool .pytest .ini_options ]
4881testpaths = [" tests" ]
4982filterwarnings = [
@@ -57,9 +90,16 @@ source = ["click", "tests"]
5790[tool .coverage .paths ]
5891source = [" src" , " */site-packages" ]
5992
93+ [tool .coverage .report ]
94+ exclude_also = [
95+ " if t.TYPE_CHECKING" ,
96+ " raise NotImplementedError" ,
97+ " : \\ .{3}" ,
98+ ]
99+
60100[tool .mypy ]
61101python_version = " 3.10"
62- files = [" src/click " , " tests/typing" ]
102+ files = [" src" , " tests/typing" ]
63103show_error_codes = true
64104pretty = true
65105strict = true
@@ -72,7 +112,7 @@ ignore_missing_imports = true
72112
73113[tool .pyright ]
74114pythonVersion = " 3.10"
75- include = [" src/click " , " tests/typing" ]
115+ include = [" src" , " tests/typing" ]
76116typeCheckingMode = " basic"
77117
78118[tool .ruff ]
@@ -92,7 +132,7 @@ select = [
92132 " W" , # pycodestyle warning
93133]
94134ignore = [
95- " UP038" , # keep isinstance tuples
135+ " UP038" , # keep isinstance tuple
96136]
97137
98138[tool .ruff .lint .isort ]
@@ -103,3 +143,70 @@ order-by-type = false
103143tag-only = [
104144 " slsa-framework/slsa-github-generator" ,
105145]
146+
147+ [tool .tox ]
148+ env_list = [
149+ " py3.13" , " py3.12" , " py3.11" , " py3.10" ,
150+ " pypy3.11" ,
151+ " style" ,
152+ " typing" ,
153+ " docs" ,
154+ ]
155+
156+ [tool .tox .env_run_base ]
157+ description = " pytest on latest dependency versions"
158+ runner = " uv-venv-lock-runner"
159+ package = " wheel"
160+ wheel_build_env = " .pkg"
161+ constrain_package_deps = true
162+ use_frozen_constraints = true
163+ dependency_groups = [" tests" ]
164+ commands = [[
165+ " pytest" , " -v" , " --tb=short" , " --basetemp={env_tmp_dir}" ,
166+ {replace = " posargs" , default = [], extend = true },
167+ ]]
168+
169+ [tool .tox .env .style ]
170+ description = " run all pre-commit hooks on all files"
171+ dependency_groups = [" pre-commit" ]
172+ skip_install = true
173+ commands = [[" pre-commit" , " run" , " --all-files" ]]
174+
175+ [tool .tox .env .typing ]
176+ description = " run static type checkers"
177+ dependency_groups = [" typing" ]
178+ commands = [
179+ [" mypy" ],
180+ ]
181+
182+ [tool .tox .env .docs ]
183+ description = " build docs"
184+ dependency_groups = [" docs" ]
185+ commands = [[" sphinx-build" , " -E" , " -W" , " -b" , " dirhtml" , " docs" , " docs/_build/dirhtml" ]]
186+
187+ [tool .tox .env .docs-auto ]
188+ description = " continuously rebuild docs and start a local server"
189+ dependency_groups = [" docs" , " docs-auto" ]
190+ commands = [[" sphinx-autobuild" , " -W" , " -b" , " dirhtml" , " --watch" , " src" , " docs" , " docs/_build/dirhtml" ]]
191+
192+ [tool .tox .env .update-actions ]
193+ description = " update GitHub Actions pins"
194+ labels = [" update" ]
195+ dependency_groups = [" gha-update" ]
196+ skip_install = true
197+ commands = [[" gha-update" ]]
198+
199+ [tool .tox .env .update-pre_commit ]
200+ description = " update pre-commit pins"
201+ labels = [" update" ]
202+ dependency_groups = [" pre-commit" ]
203+ skip_install = true
204+ commands = [[" pre-commit" , " autoupdate" , " --freeze" , " -j4" ]]
205+
206+ [tool .tox .env .update-requirements ]
207+ description = " update uv lock"
208+ labels = [" update" ]
209+ dependency_groups = []
210+ no_default_groups = true
211+ skip_install = true
212+ commands = [[" uv" , " lock" , {replace = " posargs" , default = [" -U" ], extend = true }]]
0 commit comments