[tox]
envlist =
    py{310, 311, 312, 313, 314}
    pypy{311}
    pep8
    ruff
    packaging
    noextra
    mypy
isolated_build = True

[testenv]
package = wheel
wheel_build_env = build_wheel
deps =
    pytest
    pytest-cov
    pytest-icdiff
commands =
    pytest -Wall --strict-markers --cov {posargs}
extras = md

[testenv:mypy]
basepython = python3
deps =
    mypy
    types-bleach
    types-docutils
    types-Pygments
commands = mypy readme_renderer

[testenv:pep8]
basepython = python3
skip_install = true
deps =
    flake8
    pep8-naming
commands = flake8 readme_renderer tests

[testenv:ruff]
skip_install = true
deps =
    ruff
commands = ruff check

[testenv:packaging]
deps =
    check-manifest
    build
    twine
commands =
    check-manifest
    python -m build
    python -m twine check dist/*

[testenv:noextra]
basepython = python3
extras =

[testenv:resourcewarnings]
description = run tests with resource warnings enabled, slower but useful to catch leaks
setenv =
    PYTHONTRACEMALLOC=20
commands =
    pytest -Wall --strict-markers {posargs}

[flake8]
select = E,W,F,N
max-line-length = 88
