1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
[tox]
requires =
tox>=4
envlist =
clean
py3{9,10,11,12,13}
report
style
typecheck
spellcheck
skip_missing_interpreters = true
# Configuration that allows us to split tests across GitHub runners effectively
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
3.13: py313
[testenv]
runner = uv-venv-lock-runner
description = Pytest with coverage
labels = test
pass_env =
# getpass.getuser() sources for Windows:
LOGNAME
USER
LNAME
USERNAME
# Pass user color preferences through
PY_COLORS
FORCE_COLOR
NO_COLOR
CLICOLOR
CLICOLOR_FORCE
PYTHON_GIL
dependency_groups =
test
depends =
py3{9,10,11,12,13}: clean
report: py3{9,10,11,12,13}
commands =
python -m coverage run -m pytest -svx --doctest-modules \
--durations=20 --durations-min=1.0 \
{posargs}
[testenv:report]
skip_install = true
commands =
coverage combine
coverage report
coverage xml
[testenv:clean]
deps = coverage[toml]
skip_install = true
commands = coverage erase
[testenv:doc]
skip_install = true
dependency_groups =
doc
commands =
sphinx-build -M html docs docs/_build -W
[testenv:style]
runner = uv-venv-runner
description = Check our style guide
labels = check
deps =
ruff
skip_install = true
commands =
ruff check --diff
ruff format --diff
[testenv:style-fix]
runner = uv-venv-runner
description = Auto-apply style guide to the extent possible
labels = pre-release
deps =
ruff
skip_install = true
commands =
ruff check --fix
ruff format
ruff check --select ISC001
[testenv:spellcheck]
runner = uv-venv-runner
description = Check spelling
labels = check
deps =
codespell[toml]
skip_install = true
commands =
codespell . {posargs}
[testenv:typecheck]
description = Check type consistency
labels = check
dependency_groups =
types
skip_install = true
commands =
mypy --strict src tests
pyright src tests
[testenv:build{,-strict}]
labels =
check
pre-release
deps =
build
twine
skip_install = true
set_env =
# Ignore specific known warnings:
# https://github.com/pypa/pip/issues/11684
# https://github.com/pypa/pip/issues/12243
strict: PYTHONWARNINGS=error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:Unimplemented abstract methods {'locate_file'}:DeprecationWarning:pip._internal.metadata.importlib._dists
commands =
python -m build
python -m twine check dist/*
[testenv:publish]
depends = build
labels = release
deps =
twine
skip_install = true
commands =
python -m twine upload dist/*
|