{% set raw_testenv_setenv = testenv_setenv %}
{% set testenv_setenv = ['pure: PURE_PYTHON=1', '!pure-!pypy3: PURE_PYTHON=0'] + testenv_setenv %}
{% set coverage_setenv = ['PURE_PYTHON=1'] + coverage_setenv %}
[tox]
minversion = 4.0
envlist =
    release-check
    lint
{% for py_version in supported_python_versions %}
    py%(py_version)s,py%(py_version)s-pure
{% endfor %}
{% if with_future_python %}
    py%(future_python_shortversion)s,py%(future_python_shortversion)s-pure
{% endif %}
{% if with_pypy %}
    pypy3
{% endif %}
{% if with_docs %}
    docs
{% endif %}
    coverage
{% for line in additional_envlist %}
    %(line)s
{% endfor %}
{% include 'tox-testenv.j2' %}

[testenv:coverage]
basepython = %(coverage_basepython)s
allowlist_externals =
    mkdir
deps =
    coverage[toml]
{% for line in testenv_deps %}
    %(line)s
{% endfor %}
setenv =
{% for line in coverage_setenv %}
    %(line)s
{% endfor %}
commands =
    mkdir -p {toxinidir}/parts/htmlcov
{% if coverage_command %}
  {% for line in coverage_command %}
    %(line)s
  {% endfor %}
{% else %}
    coverage run -m zope.testrunner --test-path=src {posargs:-vc}
{% endif %}
    coverage html
    coverage report
{% for line in coverage_additional %}
%(line)s
{% endfor %}
{% include 'tox-lint.j2' %}
{% include 'tox-docs.j2' %}
