Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: use toml for tox #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
90 changes: 90 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,93 @@ known_first_party = ["mddj"]

[tool.check-sdist]
git-only = [".*", "Makefile", "docs/*", "scripts/*"]


[tool.tox]
requires = ["tox>=4.22"]
env_list = [
"lint",
"mypy",
"covclean",
"covcombine",
"covreport",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]

[tool.tox.labels]
ci = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "covcombine", "covreport"]
ci-mypy = ["mypy-py38", "mypy-py313"]
ci-package-check = ["twine-check"]

[tool.tox.env_run_base]
description = "Run tests and coverage"
package = "wheel"
wheel_build_env = "build_wheel"
dependency_groups = ["test"]
commands = [["coverage", "run", "-m", "pytest", "-v", {replace = "posargs", extend = true}]]
depends = ["clean"]

[tool.tox.env.covclean]
description = "Clean coverage outputs"
skip_install = true
dependency_groups = ["coverage"]
commands = [["coverage", "erase"]]

[tool.tox.env.covcombine]
description = "Combine coverage outputs"
skip_install = true
dependency_groups = ["coverage"]
commands = [["coverage", "combine"]]
depends = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

[tool.tox.env.covreport]
description = "Report on combined coverage outputs"
skip_install = true
dependency_groups = ["coverage"]
commands_pre = [["coverage", "html", "--fail-under=0"]]
commands = [["coverage", "report"]]
depends = ["covcombine"]

[tool.tox.env.lint]
description = "Run linterse and formatters"
dependency_groups = ["lint"]
commands = [["pre-commit", "run", "-a", {replace = "posargs", extend = true}]]
depends = []

[tool.tox.env.mypy]
package = "skip"
description = "Run static type checking under {base_python}"
dependency_groups = ["typing"]
commands = [["mypy", "src/", {replace = "posargs", extend = true} ]]
depends = []

[tool.tox.env.mypy-py38]
base = ["tool.tox.env.mypy"]

[tool.tox.env.mypy-py313]
base = ["env.mypy"]
Comment on lines +169 to +172
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, by the way, either seems to work, was testing. The config will show the full section name, tool.tox.env.mypy.


[tool.tox.env.twine-check]
description = "check the metadata on a package build"
allowlist_externals = ["rm"]
dependency_groups = ["build"]
commands_pre = [["rm", "-rf", "dist/"]]
# check that twine validating package data works
commands = [["python", "-m", "build"],
["twine", "check", "dist/*"]]


[tool.tox.env.docs]
description = "build docs with sphinx"
basepython = ["python3.12"]
dependency_groups = ["docs"]
allowlist_externals = ["rm"]
changedir = "docs/"
# clean the build dir before rebuilding
commands_pre = [["rm", "-rf", "_build/"]]
commands = [["sphinx-build", "-d", "_build/doctrees", "-b", "dirhtml", "-W", ".", "_build/dirhtml", {replace = "posargs", extend = true}]]
70 changes: 0 additions & 70 deletions tox.ini

This file was deleted.

Loading