# To use tox, see https://tox.readthedocs.io
# (you may also want to install tox-uv)
# then run `tox` or `tox -- {pytest args}`
# run in parallel using `tox -p`
[tox]
envlist = py39

[testenv]
usedevelop = true

[testenv:py{39,310,311,312,313}]
description = Run unit tests with this Python version
extras =
    testing
commands = pytest {posargs}

[testenv:py{39,310,311,312,313}-no-myst]
description = Run unit tests with this Python version
extras =
    testing-no-myst
commands = pytest {posargs}

[testenv:docs-{alabaster,rtd,pydata,sbt,furo,im}]
description =
    Run documentation build for this theme
extras =
    rtd
    rtd: theme_rtd
    pydata: theme_pydata
    sbt: theme_sbt
    furo: theme_furo
    im: theme_im
allowlist_externals = echo
passenv =
    BUILDER
    CLEAN
    TERM
setenv =
    alabaster: SPHINX_THEME = alabaster
    rtd: SPHINX_THEME = sphinx_rtd_theme
    pydata: SPHINX_THEME = pydata_sphinx_theme
    sbt: SPHINX_THEME = sphinx_book_theme
    furo: SPHINX_THEME = furo
    im: SPHINX_THEME = sphinx_immaterial
commands_pre =
  python -c "import shutil; shutil.rmtree('docs/_build/{env:BUILDER:html}/{env:SPHINX_THEME:}', ignore_errors=True) if '{env:CLEAN:}' else None"
commands =
    sphinx-build -nW --keep-going {posargs} -b {env:BUILDER:html} docs/ docs/_build/{env:BUILDER:html}/{env:SPHINX_THEME:}
commands_post = echo "open docs/_build//{env:BUILDER:html}/{env:SPHINX_THEME:}/index.html"
