[tox]
envlist = py27,py35,py36,py37,py38,py39,py310,black,pep8py2,pep8py3,doc
skip_missing_interpreters = true

[testenv]
commands =
    coverage run --parallel-mode tests.py
    coverage combine
    coverage xml
    coverage report -m
deps =
    lxml
    coverage

[testenv:py38]
# lxml FTBFS because Python sets -Wimplicit-int
deps = coverage

[testenv:black]
commands = black --check --verbose \
    {toxinidir}/setup.py \
    {toxinidir}/tests.py \
    {toxinidir}/defusedxml/
deps = black

[testenv:pep8py2]
basepython = python2.7
deps =
    flake8
commands =
    {envpython} -m flake8

[testenv:pep8py3]
basepython = python3
deps =
    flake8
commands =
    {envpython} -m flake8

[testenv:doc]
basepython = python3
deps =
    docutils
commands =
    python setup.py check --restructuredtext --metadata --strict

[pytest]
norecursedirs = build .tox
python_files = tests.py

[flake8]
exclude = .tox,*.egg,dist,build,other
show-source = true
ignore = E402, F811
max-line-length = 98

[gh-actions]
python =
    2.7: py27, pep8py2
    3.5: py35
    3.6: py36
    3.7: py37
    3.8: py38, pep8py3, doc
    3.9: py39, black
    3.10: py310
