[tox]
envlist =
   py27,
   py27_zope213,
   py35,
   py36,
   py37,
   flake8,
   coverage,

[testenv]
commands =
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:sources-dir={toxinidir}/src bootstrap
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:sources-dir={toxinidir}/src install test
    coverage run {envbindir}/test --verbose --auto-color

skip_install = true
deps =
    setuptools>=36.2
    six
    zc.buildout
    coverage

setenv =
    COVERAGE_FILE=.coverage.{envname}

[testenv:py27_zope213]
basepython = python2.7
commands =
    {envbindir}/buildout -c {toxinidir}/buildout_213.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:sources-dir={toxinidir}/src bootstrap
    {envbindir}/buildout -c {toxinidir}/buildout_213.cfg buildout:directory={envdir} buildout:develop={toxinidir} buildout:sources-dir={toxinidir}/src install test
    {envbindir}/test --verbose --auto-color

skip_install = true
deps =
    setuptools>=36.2
    six
    zc.buildout

[testenv:coverage]
basepython = python3.7
deps = coverage
setenv =
    COVERAGE_FILE=.coverage
commands =
    coverage erase
    coverage combine
    coverage html --include="Products/ZMySQLDA/*"
    coverage xml --include="Products/ZMySQLDA/*"
    coverage report --include="Products/ZMySQLDA/*" --fail-under=85

[testenv:flake8]
basepython = python3.7
deps =
    flake8
    flake8-html
    flake8-debugger

commands =
    - flake8 --format=html --htmldir={toxinidir}/parts/flake8 --doctests Products setup.py {posargs}
    flake8 --doctests Products setup.py {posargs}

