[tox]
envlist = py36, py37, py38, py39, pypy3, pygments, flake8, checkspelling, pep517check, checklinks
isolated_build = True

[testenv]
extras = testing
deps = pytidylib
commands =
    coverage run --source=markdown -m unittest discover {toxinidir}/tests
    coverage xml
    coverage report --show-missing

[testenv:pygments]
# Run tests with pygments installed (override deps only).
setenv =
    PYGMENTS_VERSION = 2.7.1
deps =
    pytidylib
    pygments=={env:PYGMENTS_VERSION}

[testenv:flake8]
deps = flake8
commands = flake8 {toxinidir}/markdown {toxinidir}/tests {toxinidir}/setup.py
skip_install = true

[testenv:checkspelling]
deps =
    mkdocs
    mkdocs_nature
commands = {toxinidir}/checkspelling.sh

[testenv:checklinks]
whitelist_externals = markdown-link-check
deps =
commands = {toxinidir}/checklinks.sh

[testenv:pep517check]
deps = pep517
commands = python -m pep517.check {toxinidir}
skip_install = true

[flake8]
max-line-length = 119
exclude=markdown/pep562.py
