# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/zope-product
[tox]
minversion = 3.18
envlist =
    lint
    py27
    coverage

[testenv]
skip_install = true
setenv =
    TZ = CET
deps =
    zc.buildout == 2.3.1
    wheel > 0.37
commands_pre =
    {envbindir}/buildout -nc {toxinidir}/buildout213.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
commands =
    {envbindir}/test {posargs:-cv}

[testenv:lint]
basepython = python2.7
commands_pre =
    mkdir -p {toxinidir}/parts/flake8
allowlist_externals =
    mkdir
commands =
    isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
    flake8 {toxinidir}/src {toxinidir}/setup.py
    check-manifest
deps =
    check-manifest
    flake8
    isort
    # Useful flake8 plugins that are Python and Plone specific:
    flake8-debugger
    mccabe

[testenv:isort-apply]
basepython = python3
commands_pre =
deps =
    isort
commands =
    isort {toxinidir}/src {toxinidir}/setup.py []

[testenv:coverage]
basepython = python2.7
skip_install = true
allowlist_externals =
    mkdir
deps =
    {[testenv]deps}
    coverage
    coverage-python-version
commands =
    mkdir -p {toxinidir}/parts/htmlcov
    coverage run {envbindir}/test {posargs:-cv}
    coverage html
    coverage report -m --fail-under=76

[coverage:run]
branch = True
plugins = coverage_python_version
source = Products.Formulator

[coverage:report]
precision = 2
exclude_lines =
    pragma: no cover
    pragma: nocover
    except ImportError:
    raise NotImplementedError
    if __name__ == '__main__':
    self.fail
    raise AssertionError

[coverage:html]
directory = parts/htmlcov
