[tox]
envlist = py39,py310,py311,py312,py313,py39-parsel,twinecheck

[testenv]
deps =
    pytest
    pytest-cov >= 7.0.0
    py39-parsel: parsel
commands =
    pytest --cov=html_text --cov-report=xml --cov-report=term-missing {env:PYTEST_DOC:} {posargs:.}

[testenv:py39-parsel]
setenv =
    PYTEST_DOC = --doctest-modules --doctest-glob='*.rst'

[testenv:twinecheck]
basepython = python3
deps =
    twine==6.2.0
    build==1.3.0
commands =
    python -m build --sdist
    twine check dist/*

[testenv:pre-commit]
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
skip_install = true

[testenv:typing]
basepython = python3
deps =
    mypy==1.18.2
    parsel==1.10.0
    pytest==8.4.2
    types-lxml==2025.8.25
commands =
    mypy {posargs: html_text tests}
