[tox]
envlist=
    lint
    py{310,311,312,313,314}-marshmallow{3,4}
    py314-marshmallowdev
    py310-lowest
    docs

[testenv]
extras = tests
deps =
    marshmallow3: marshmallow>=3.18.0,<4.0.0
    marshmallowdev: https://github.com/marshmallow-code/marshmallow/archive/dev.tar.gz
    lowest: marshmallow==3.18.0
commands = pytest {posargs}

[testenv:lint]
deps = pre-commit~=3.5
skip_install = true
commands = pre-commit run --all-files

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

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

[testenv:watch-docs]
deps = sphinx-autobuild
extras = docs
commands = sphinx-autobuild --open-browser docs/ docs/_build {posargs} --watch src/apispec --delay 2

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