| 1 |
# To use tox, see https://tox.readthedocs.io |
| 2 |
# (you may also want to install tox-uv) |
| 3 |
# then run `tox` or `tox -- {pytest args}` |
| 4 |
# run in parallel using `tox -p` |
| 5 |
[tox] |
| 6 |
envlist = py311 |
| 7 |
|
| 8 |
[testenv] |
| 9 |
usedevelop = true |
| 10 |
|
| 11 |
[testenv:py{311,312,313,314}] |
| 12 |
description = Run unit tests with this Python version |
| 13 |
extras = |
| 14 |
testing |
| 15 |
commands = pytest {posargs} |
| 16 |
|
| 17 |
[testenv:py{311,312,313,314}-no-myst] |
| 18 |
description = Run unit tests with this Python version |
| 19 |
extras = |
| 20 |
testing-no-myst |
| 21 |
commands = pytest {posargs} |
| 22 |
|
| 23 |
[testenv:docs-{alabaster,rtd,pydata,sbt,furo,im}] |
| 24 |
description = |
| 25 |
Run documentation build for this theme |
| 26 |
extras = |
| 27 |
rtd |
| 28 |
rtd: theme_rtd |
| 29 |
pydata: theme_pydata |
| 30 |
sbt: theme_sbt |
| 31 |
furo: theme_furo |
| 32 |
im: theme_im |
| 33 |
allowlist_externals = echo |
| 34 |
passenv = |
| 35 |
BUILDER |
| 36 |
CLEAN |
| 37 |
TERM |
| 38 |
setenv = |
| 39 |
alabaster: SPHINX_THEME = alabaster |
| 40 |
rtd: SPHINX_THEME = sphinx_rtd_theme |
| 41 |
pydata: SPHINX_THEME = pydata_sphinx_theme |
| 42 |
sbt: SPHINX_THEME = sphinx_book_theme |
| 43 |
furo: SPHINX_THEME = furo |
| 44 |
im: SPHINX_THEME = sphinx_immaterial |
| 45 |
commands_pre = |
| 46 |
python -c "import shutil; shutil.rmtree('docs/_build/{env:BUILDER:html}/{env:SPHINX_THEME:}', ignore_errors=True) if '{env:CLEAN:}' else None" |
| 47 |
commands = |
| 48 |
sphinx-build -nW --keep-going {posargs} -b {env:BUILDER:html} docs/ docs/_build/{env:BUILDER:html}/{env:SPHINX_THEME:} |
| 49 |
commands_post = echo "open docs/_build//{env:BUILDER:html}/{env:SPHINX_THEME:}/index.html" |
| 50 |
|
| 51 |
[testenv:mypy] |
| 52 |
description = Run type checking with mypy |
| 53 |
dependency_groups = mypy |
| 54 |
commands = mypy {posargs:sphinx_design} |
| 55 |
|
| 56 |
[testenv:ruff-check] |
| 57 |
description = Run linting with ruff (use --fix to auto-fix) |
| 58 |
dependency_groups = ruff |
| 59 |
commands = ruff check {posargs:--fix} |
| 60 |
|
| 61 |
[testenv:ruff-fmt] |
| 62 |
description = Run formatting with ruff |
| 63 |
dependency_groups = ruff |
| 64 |
commands = ruff format {posargs} |