[tox]
distribute = False
envlist =
    coverage_setup
    nopil
    py{36,37,38,39,310}
    readme
    coverage_report
skip_missing_interpreters = True

[gh-actions]
python =
    3.7: py37
    3.8: py38
    3.9: py39, readme, nopil
    3.10: py310

[testenv]
depends = coverage_setup
usedevelop = True
extras =
    test
    pil
commands = coverage run -m pytest

[testenv:nopil]
extras =
    test

[testenv:readme]
skip_install = True
deps =
    docutils
    Pygments
commands =
    {envbindir}/rst2html.py --report=info --halt=warning README.rst /dev/null
    {envbindir}/rst2html.py --report=info --halt=warning CHANGES.rst /dev/null

[testenv:coverage_setup]
depends =
skip_install = True
deps = coverage
commands = coverage erase

[testenv:coverage_report]
depends =
    py{36,37,38,39,310}
    nopil
skip_install = True
deps = coverage
commands =
  coverage combine
  coverage html
  coverage report --omit="qrcode/tests/*" --fail-under=98 -m
  coverage report --include="qrcode/tests/*" --no-skip-covered --fail-under=100 -m
