Skip to content

Commit e4078ff

Browse files
authored
🔧 chore(tox): migrate tox.ini to tox.toml (#217)
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 f8c42ad commit e4078ff

3 files changed

Lines changed: 68 additions & 72 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.2.1"]
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 & 68 deletions
This file was deleted.

‎tox.toml‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
requires = [ "tox>=4.30.3", "tox-uv>=1.28" ]
2+
env_list = [ "3.14", "3.13", "3.12", "3.11", "3.10", "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 = [ "DIFF_AGAINST", "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 = "posargs", extend = true, default = [
18+
"--cov",
19+
"{env_site_packages_dir}{/}devpi_process",
20+
"--cov",
21+
"{tox_root}{/}tests",
22+
"--cov-config=pyproject.toml",
23+
"--no-cov-on-fail",
24+
"--cov-report",
25+
"term-missing:skip-covered",
26+
"--cov-context=test",
27+
"--cov-report",
28+
"html:{env_tmp_dir}{/}htmlcov",
29+
"--cov-report",
30+
"xml:{work_dir}{/}coverage.{env_name}.xml",
31+
"--junitxml",
32+
"{work_dir}{/}junit.{env_name}.xml",
33+
"tests",
34+
] },
35+
],
36+
]
37+
38+
[env.fix]
39+
description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
40+
skip_install = true
41+
deps = [ "pre-commit-uv>=4.1.5" ]
42+
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]
43+
44+
[env.pkg_meta]
45+
description = "check that the long description is valid"
46+
skip_install = true
47+
deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.8.22" ]
48+
commands = [
49+
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
50+
[ "twine", "check", "{env_tmp_dir}{/}*" ],
51+
[ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ],
52+
]
53+
54+
[env.type]
55+
description = "run type check on code base"
56+
deps = [ "mypy==1.18.2" ]
57+
commands = [ [ "mypy", "src" ], [ "mypy", "tests" ] ]
58+
59+
[env.dev]
60+
description = "generate a DEV environment"
61+
package = "editable"
62+
commands = [
63+
[ "uv", "pip", "tree" ],
64+
[ "python", "-c", "import sys; print(sys.executable)" ],
65+
]

0 commit comments

Comments
 (0)