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

Migrate from tox.ini to pyproject.toml #118

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,67 @@ write_to = "src/tox_extra/_version.py"
in_place = true
sort_inline_tables = true
sort_table_keys = true

[tool.tox]
envlist = ["lint", "pkg", "py", "devel"]
requires = ["tox-uv >= 1.16.0"]

[tool.tox.env.devel]
deps = ["tox @ git+https://github.com/tox-dev/tox.git@main"]
description = "Run tests using devel branch of tox (unreleased)"

[tool.tox.env.lint]
commands = [
[
"python3",
"-m",
"pre_commit",
"run",
"{posargs:--all}"
]
]
deps = ["pre_commit"]
description = "Run linting"
skip_install = true

[tool.tox.env.pkg]
commands = [
["rm", "-rfv", "{toxinidir}/dist/"],
["python", "-m", "build", "--outdir", "{toxinidir}/dist/", "{toxinidir}"],
# metadata validation
["sh", "-c", "python3 -m twine check --strict {toxinidir}/dist/*"],
# Install the wheel
["sh", "-c", "python3 -m pip install {toxinidir}/dist/*.whl"]
]
deps = [
"build >= 0.9.0",
"twine >= 4.0.1",
"pip"
]
description = "Test packaging"
# don't install package in this env
skip_install = true
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted
usedevelop = false

[tool.tox.env."py{39,310,311,312,313}-devel"]
deps = ["tox @ git+https://github.com/tox-dev/tox.git@main"]
description = "Run tests using devel branch of tox (unreleased)"

[tool.tox.env_run_base]
allowlist_externals = [
"sh",
"rm"
]
commands = [
["python", "-m", "coverage", "run", "-m", "pytest", "{posargs:}"],
["sh", "-c", "python -m coverage combine -q --data-file={env:COVERAGE_FILE} {env:COVERAGE_FILE}.* && coverage report && coverage xml"]
]
description = "Run tests"
extras = ["test"]
package = "editable"
pass_env = ["SSH_AUTH_SOCK"]
requires = ["tox-uv"]
set_env = {COVERAGE_FILE = "{env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}", COVERAGE_PROCESS_START = "{toxinidir}/pyproject.toml", GIT_AUTHOR_EMAIL = "noreply@example.com", GIT_AUTHOR_NAME = "John Doe", GIT_COMMITTER_EMAIL = "noreply@example.com", GIT_COMMITTER_NAME = "John Doe", PIP_DISABLE_PIP_VERSION_CHECK = "1"}
skip_install = false
usedevelop = true
67 changes: 0 additions & 67 deletions tox.ini

This file was deleted.