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

[testenv]
commands =
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
    {envbindir}/test {posargs}
deps =
    zc.buildout
skip_install = true

[testenv:coverage]
basepython = python3.6
commands =
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
    {envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test
    coverage erase
    coverage run {envbindir}/test {posargs}
    - coverage combine
    - coverage html
    - coverage xml
    coverage report
deps = 
    {[testenv]deps}
    coverage
setenv =
    COVERAGE_FILE=.coverage

[testenv:flake8]
basepython = python3.6
commands =
    - flake8 --format=html --htmldir={toxinidir}/parts/flake8 --doctests Products tests setup.py {posargs}
    flake8 --doctests Products tests setup.py {posargs}
deps =
    flake8
    flake8-html
    flake8-debugger

[testenv:docs]
basepython =
    python3.6
pip_pre = True
commands =
    sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html
deps =
    .[docs]
