Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ repos:
hooks:
- id: codespell
args: ["--write-changes"]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.7.1"
- repo: https://github.com/tox-dev/tox-toml-fmt
rev: "v1.7.0"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- id: tox-toml-fmt
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.16.0"
hooks:
Expand Down
70 changes: 0 additions & 70 deletions tox.ini

This file was deleted.

66 changes: 66 additions & 0 deletions tox.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
requires = [ "tox>=4.31", "tox-uv>=1.28.1" ]
env_list = [ "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "fix", "pkg_meta", "type" ]
skip_missing_interpreters = true

[env_run_base]
description = "run the unit tests with pytest under {env_name}"
package = "wheel"
wheel_build_env = ".pkg"
extras = [ "testing" ]
pass_env = [ "PYTEST_*" ]
set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" }
commands = [
[
"python",
"-m",
"pytest",
{ replace = "posargs", extend = true, default = [
"--cov",
"{env_site_packages_dir}{/}pre_commit_uv",
"--cov",
"{tox_root}{/}tests",
"--cov-config=pyproject.toml",
"--no-cov-on-fail",
"--cov-report",
"term-missing:skip-covered",
"--cov-context=test",
"--cov-report",
"html:{env_tmp_dir}{/}htmlcov",
"--cov-report",
"xml:{work_dir}{/}coverage.{env_name}.xml",
"--junitxml",
"{work_dir}{/}junit.{env_name}.xml",
"tests",
] },
],
]

[env.fix]
description = "format the code base to adhere to our styles, and complain about what we cannot do automatically"
skip_install = true
deps = [ "pre-commit-uv>=4.1.1" ]
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]

[env.pkg_meta]
description = "check that the long description is valid"
skip_install = true
deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.9.1" ]
commands = [
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
[ "twine", "check", "{env_tmp_dir}{/}*" ],
[ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ],
]

[env.type]
description = "run type check on code base"
deps = [ "mypy==1.18.2" ]
commands = [ [ "mypy", "src" ], [ "mypy", "tests" ] ]

[env.dev]
description = "generate a DEV environment"
package = "editable"
commands = [
[ "uv", "tree" ],
[ "python", "-c", "import sys; print(sys.executable)" ],
[ "python", "task/dev_pth.py", "{env_site_packages_dir}" ],
]