[tox]
# https://tox.wiki/en/latest/example/package.html#flit
isolated_build = True

envlist =
  docs
  py{38}-sphinx{5,6}
  py{39}-sphinx{5,6,7}
  py{310,311,312}-sphinx{5,6,7,8,latest,dev}

[testenv]
deps =
  pytest
  pdbpp
  defusedxml
  .
  sphinx5: sphinx<6.0
  sphinx6: sphinx<7.0
  sphinx7: sphinx<8.0
  sphinx8: sphinx<9.0
  sphinxlatest: sphinx
  sphinxdev: https://github.com/sphinx-doc/sphinx/archive/refs/heads/master.zip
commands = pytest {posargs}

[testenv:docs]
deps =
  -r {toxinidir}/docs/requirements.txt
  .
changedir = {toxinidir}/docs
commands =
    sphinx-build -q -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
