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

tox: format file #678

Merged
merged 1 commit into from
Sep 6, 2023
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
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.3.1"
hooks:
- id: tox-ini-fmt
76 changes: 39 additions & 37 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
[tox]
envlist =
requires =
tox>=4.2
virtualenv>=20.0.34
env_list =
fix
type
docs
path
{py312, py311, py310, py39, py38, py37, pypy37, pypy38, pypy39}{, -min}
isolated_build = true
{py312, py311, py310, py39, py38, py37, pypy39, pypy38, pypy37}{, -min}
skip_missing_interpreters = true
minversion = 3.14
requires =
virtualenv>=20.0.34

[testenv]
description =
run test suite with {basepython}
passenv =
extras =
test
pass_env =
LC_ALL
PIP_*
PYTEST_*
TERM
setenv =
set_env =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
TEST_STATUS_DIR = {envtmpdir}
PYPY3323BUG = 1
PYTHONWARNDEFAULTENCODING = 1
extras =
test
TEST_STATUS_DIR = {envtmpdir}
commands =
pytest -ra --cov --cov-config pyproject.toml \
--cov-report=html:{envdir}/htmlcov --cov-context=test \
--cov-report=xml:{toxworkdir}/coverage.{envname}.xml {posargs:-n auto}

[testenv:fix]
description = run static analysis and style checks
passenv =
HOMEPATH
PROGRAMDATA
basepython = python3.9
base_python = python3.9
skip_install = true
deps =
pre-commit>=2
pass_env =
HOMEPATH
PROGRAMDATA
commands =
pre-commit run --all-files --show-diff-on-failure
python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")'

[testenv:path]
description = verify build can run from source (bootstrap)
setenv =
PYTHONPATH = {toxinidir}/src
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
commands_pre =
python -E -m pip uninstall -y build colorama

[testenv:type]
description = run type check on code base
extras = typing
setenv =
extras =
typing
set_env =
PYTHONWARNDEFAULTENCODING =
commands =
mypy

[testenv:{py312, py311, py310, py39, py38, py37, pypy37, pypy38, pypy39}-min]
description = check minimum versions required of all dependencies
skip_install = true
commands_pre =
pip install .[test] -c tests/constraints.txt

[testenv:docs]
description = build documentations
basepython = python3.10
base_python = python3.10
extras =
docs
commands =
sphinx-build -n docs {envtmpdir} {posargs:-W}
python -c 'print("Documentation available under file://{envtmpdir}/index.html")'

[testenv:path]
description = verify build can run from source (bootstrap)
set_env =
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
PYTHONPATH = {toxinidir}/src
commands_pre =
python -E -m pip uninstall -y build colorama

[testenv:{py312, py311, py310, py39, py38, py37, pypy37, pypy38, pypy39}-min]
description = check minimum versions required of all dependencies
skip_install = true
commands_pre =
pip install .[test] -c tests/constraints.txt

[testenv:dev]
description = generate a DEV environment
usedevelop = true
package = editable
deps =
virtualenv>=20.0.34
extras =
Expand All @@ -89,18 +89,20 @@ commands =

[testenv:coverage]
description = combine coverage from test environments
passenv =
DIFF_AGAINST
setenv =
skip_install = true
deps =
coverage[toml]>=5.1
diff_cover>=3
parallel_show_output = true
pass_env =
DIFF_AGAINST
set_env =
commands =
coverage combine {toxworkdir}
coverage report --skip-covered --show-missing -i
coverage xml -o {toxworkdir}/coverage.xml -i
coverage html -d {toxworkdir}/htmlcov -i
python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
depends = {py312, py311, py310, py39, py38, py37, pypy37, pypy38, pypy39}{,-min}, path
depends =
path
{py312, py311, py310, py39, py38, py37, pypy39, pypy38, pypy37}{, -min}