[tox]
envlist = lint,mypy,py{39,310,311,312,313},docs

[testenv]
extras = tests
commands = pytest {posargs}

[testenv:lint]
deps = pre-commit>=3.5,<5.0
skip_install = true
commands = pre-commit run --all-files

[testenv:mypy]
deps = 
  mypy>=1.14.1
  types-simplejson
commands = mypy --show-error-codes

[testenv:docs]
extras = docs
commands = sphinx-build --fresh-env docs/ docs/_build {posargs}

; Below tasks are for development only (not run in CI)

[testenv:docs-serve]
deps = sphinx-autobuild
extras = docs
commands = sphinx-autobuild --port=0 --open-browser --delay=2 docs/ docs/_build {posargs} --watch src --watch CONTRIBUTING.rst --watch README.rst

[testenv:readme-serve]
deps = restview
skip_install = true
commands = restview README.rst

[testenv:benchmark]
usedevelop = true
commands = python performance/benchmark.py --iterations=100 --repeat=3
