| 1 |
[tox] |
| 2 |
env_list = |
| 3 |
coverage_erase |
| 4 |
# When updating the list of Python versions to test, |
| 5 |
# use search-and-replace to ensure that intra-environment |
| 6 |
# dependencies are maintained for parallel execution. |
| 7 |
py{3.15, 3.14, 3.13, 3.12, 3.11, 3.10} |
| 8 |
coverage_report |
| 9 |
mypy |
| 10 |
|
| 11 |
|
| 12 |
[testenv:coverage_erase] |
| 13 |
description = Erase coverage files |
| 14 |
dependency_groups = |
| 15 |
dev |
| 16 |
commands = |
| 17 |
coverage erase |
| 18 |
|
| 19 |
|
| 20 |
[testenv] |
| 21 |
runner = uv-venv-lock-runner |
| 22 |
dependency_groups = |
| 23 |
dev |
| 24 |
depends = |
| 25 |
py{3.15, 3.14, 3.13, 3.12, 3.11, 3.10}: coverage_erase |
| 26 |
commands = |
| 27 |
coverage run -m pytest tests/unit/ -s |
| 28 |
|
| 29 |
|
| 30 |
[testenv:coverage_report{,-ci}] |
| 31 |
description = Create a coverage report |
| 32 |
depends = |
| 33 |
py{3.15, 3.14, 3.13, 3.12, 3.11, 3.10} |
| 34 |
dependency_groups = |
| 35 |
dev |
| 36 |
commands_pre = |
| 37 |
# `coverage combine` will fail if run twice in a row. |
| 38 |
# The '-' ignores failures. |
| 39 |
- coverage combine |
| 40 |
# Only write an HTML reports when NOT running in CI. |
| 41 |
# Also, ignore the exit code if coverage falls below the fail_under value. |
| 42 |
!ci: - coverage html |
| 43 |
commands = |
| 44 |
coverage report --fail-under={env:COVERAGE_FAIL_UNDER:99} |
| 45 |
commands_post = |
| 46 |
# Only write an XML report when running in CI. |
| 47 |
ci: coverage xml --fail-under={env:COVERAGE_FAIL_UNDER:99} |
| 48 |
|
| 49 |
|
| 50 |
[testenv:lint] |
| 51 |
description = Lint the project |
| 52 |
skip_install = true |
| 53 |
dependency_groups = |
| 54 |
dev |
| 55 |
commands = |
| 56 |
mypy |
| 57 |
isort --profile hug --check --diff isort/ tests/ scripts/ |
| 58 |
isort --profile hug --check --diff example_isort_formatting_plugin/ |
| 59 |
isort --profile hug --check --diff example_isort_sorting_plugin/ |
| 60 |
isort --profile hug --check --diff example_shared_isort_profile/ |
| 61 |
flake8 isort/ tests/ |
| 62 |
ruff check |
| 63 |
ruff format --check |
| 64 |
bandit -r isort/ -x isort/_vendored |
| 65 |
|
| 66 |
|
| 67 |
[testenv:docs] |
| 68 |
description = Build the documentation |
| 69 |
skip_install = true |
| 70 |
dependency_groups = |
| 71 |
docs |
| 72 |
commands = |
| 73 |
sphinx-build --nitpicky --fail-on-warning --write-all --fresh-env --builder html docs docs/_build/html |