| 1 |
[tox] |
| 2 |
minversion = 4.2.0 |
| 3 |
envlist = py{312,313,314,315} |
| 4 |
|
| 5 |
[testenv] |
| 6 |
usedevelop = True |
| 7 |
passenv = |
| 8 |
https_proxy |
| 9 |
http_proxy |
| 10 |
no_proxy |
| 11 |
COLORTERM |
| 12 |
PERL |
| 13 |
PERL5LIB |
| 14 |
PYTEST_ADDOPTS |
| 15 |
DO_EPUBCHECK |
| 16 |
EPUBCHECK_PATH |
| 17 |
TERM |
| 18 |
CLEAN |
| 19 |
BUILDER |
| 20 |
READTHEDOCS |
| 21 |
description = |
| 22 |
py{312,313,314,315}: Run unit tests against {envname}. |
| 23 |
dependency_groups = |
| 24 |
test |
| 25 |
setenv = |
| 26 |
PYTHONWARNINGS = error |
| 27 |
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:} --color yes |
| 28 |
commands= |
| 29 |
python -X dev -X warn_default_encoding -m pytest --durations 25 {posargs} |
| 30 |
|
| 31 |
[testenv:lint] |
| 32 |
description = |
| 33 |
Run linters. |
| 34 |
dependency_groups = |
| 35 |
lint |
| 36 |
types |
| 37 |
# If you update any of these commands, don't forget to update the equivalent |
| 38 |
# GitHub Workflow step |
| 39 |
commands = |
| 40 |
ruff check . --output-format github |
| 41 |
mypy |
| 42 |
pyright |
| 43 |
|
| 44 |
[testenv:docs] |
| 45 |
description = |
| 46 |
Build documentation. |
| 47 |
dependency_groups = |
| 48 |
docs |
| 49 |
commands = |
| 50 |
python -c "import shutil; shutil.rmtree('./build/sphinx', ignore_errors=True) if '{env:CLEAN:}' else None" |
| 51 |
sphinx-build -M {env:BUILDER:html} ./doc ./build/sphinx --fail-on-warning {posargs} |
| 52 |
|
| 53 |
[testenv:docs-live] |
| 54 |
description = |
| 55 |
Build documentation. |
| 56 |
dependency_groups = |
| 57 |
docs |
| 58 |
deps = |
| 59 |
sphinx-autobuild |
| 60 |
commands = |
| 61 |
sphinx-autobuild ./doc ./build/sphinx/ |
| 62 |
|
| 63 |
[testenv:bindep] |
| 64 |
description = |
| 65 |
Install binary dependencies. |
| 66 |
deps = |
| 67 |
bindep |
| 68 |
commands = |
| 69 |
bindep test |
| 70 |
|
| 71 |
[testenv:ruff] |
| 72 |
description = |
| 73 |
Run ruff formatting and linting. |
| 74 |
dependency_groups = |
| 75 |
lint |
| 76 |
commands = |
| 77 |
ruff format . |
| 78 |
ruff check --fix . |
| 79 |
|
| 80 |
[testenv:mypy] |
| 81 |
description = |
| 82 |
Run mypy type checking. |
| 83 |
dependency_groups = |
| 84 |
types |
| 85 |
commands = |
| 86 |
mypy {posargs} |
| 87 |
|
| 88 |
[testenv:prettier] |
| 89 |
description = |
| 90 |
Run the Prettier JavaScript formatter. |
| 91 |
commands = |
| 92 |
npx [email protected] --write "sphinx/themes/**/*.js" "!sphinx/themes/bizstyle/static/css3-mediaqueries*.js" "tests/js/**/*.{js,mjs}" "!tests/js/fixtures/**" |