Skip to content

Commit 9a76ce6

Browse files
committed
🔧 chore(tox): migrate tox.ini to tox.toml
The tox ecosystem has moved to native TOML configuration. Switch from the legacy INI format and update the pre-commit hook from tox-ini-fmt to tox-toml-fmt v1.7.0.
1 parent e3808bc commit 9a76ce6

3 files changed

Lines changed: 69 additions & 71 deletions

File tree

.pre-commit-config.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ repos:
1414
hooks:
1515
- id: codespell
1616
additional_dependencies: ["tomli>=2.3"]
17-
- repo: https://github.com/tox-dev/tox-ini-fmt
18-
rev: "1.7.1"
17+
- repo: https://github.com/tox-dev/tox-toml-fmt
18+
rev: "v1.7.0"
1919
hooks:
20-
- id: tox-ini-fmt
21-
args: ["-p", "fix"]
20+
- id: tox-toml-fmt
2221
- repo: https://github.com/tox-dev/pyproject-fmt
2322
rev: "v2.16.0"
2423
hooks:

tox.ini

Lines changed: 0 additions & 67 deletions
This file was deleted.

tox.toml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
requires = [ "tox>=4.32", "tox-uv>=1.29" ]
2+
env_list = [ "3.14", "3.13", "3.12", "3.11", "3.14t", "fix", "pkg_meta", "type" ]
3+
skip_missing_interpreters = true
4+
5+
[env_run_base]
6+
description = "run the unit tests with pytest under {env_name}"
7+
package = "wheel"
8+
wheel_build_env = ".pkg"
9+
extras = [ "testing" ]
10+
pass_env = [ "PYTEST_*" ]
11+
set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" }
12+
commands = [
13+
[
14+
"python",
15+
"-m",
16+
"pytest",
17+
{ replace = "tty", default = "", value = "--color=yes" },
18+
{ replace = "posargs", extend = true, default = [
19+
"--cov",
20+
"{env_site_packages_dir}{/}sphinx_argparse_cli",
21+
"--cov",
22+
"{tox_root}{/}tests",
23+
"--cov-config=pyproject.toml",
24+
"--no-cov-on-fail",
25+
"--cov-report",
26+
"term-missing:skip-covered",
27+
"--cov-context=test",
28+
"--cov-report",
29+
"html:{env_tmp_dir}{/}htmlcov",
30+
"--cov-report",
31+
"xml:{work_dir}{/}coverage.{env_name}.xml",
32+
"--junitxml",
33+
"{work_dir}{/}junit.{env_name}.xml",
34+
"tests",
35+
] },
36+
],
37+
]
38+
39+
[env.fix]
40+
description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
41+
skip_install = true
42+
deps = [ "pre-commit-uv>=4.2" ]
43+
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]
44+
45+
[env.pkg_meta]
46+
description = "check that the long description is valid"
47+
skip_install = true
48+
deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.9.16" ]
49+
commands = [
50+
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
51+
[ "twine", "check", "{env_tmp_dir}{/}*" ],
52+
[ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ],
53+
]
54+
55+
[env.type]
56+
description = "run type check on code base"
57+
deps = [ "mypy==1.19", "types-docutils>=0.22.3.20251115" ]
58+
commands = [ [ "mypy", "src", "tests", { replace = "posargs", extend = true } ] ]
59+
60+
[env.dev]
61+
description = "generate a DEV environment"
62+
package = "editable"
63+
commands = [
64+
[ "uv", "pip", "tree" ],
65+
[ "python", "-c", "import sys; print(sys.executable)" ],
66+
]

0 commit comments

Comments
 (0)