; a generative tox configuration, see: https://testrun.org/tox/latest/config.html#generative-envlist

[tox]
envlist =

    check,
    {py35,py36},
    docs

[testenv]
basepython =
    py34: {env:TOXPYTHON:python3.4}
    {py35}: {env:TOXPYTHON:python3.5}
    py36: {env:TOXPYTHON:python3.6}
    {docs,spell,bootstrap,clean,check,report,coveralls,codecov}: {env:TOXPYTHON:python3}
setenv =
    PYTHONPATH={toxinidir}/tests
    PYTHONUNBUFFERED=yes
passenv =
    *
usedevelop = false
deps =
    -e .
    nose
    coverage
commands =
    {posargs:nosetests --exe --with-coverage --cover-package=dohlee tests}

[testenv:bootstrap]
deps =
    jinja2
    matrix
skip_install = true
commands =
    python ci/bootstrap.py
[testenv:spell]
setenv =
    SPELLCHECK=1
commands =
    sphinx-build -b spelling docs dist/docs
skip_install = true
deps =
    -r{toxinidir}/docs/requirements.txt
    sphinxcontrib-spelling
    pyenchant

[testenv:docs]
deps =
    sphinx
    sphinx_rtd_theme
    -r{toxinidir}/docs/requirements.txt
commands =
    sphinx-build {posargs:-E} -b html docs dist/docs
    sphinx-build -b linkcheck docs dist/docs

[testenv:check]
deps =
    docutils
    check-manifest
    readme-renderer
    pygments
skip_install = true
commands =
    python setup.py check --strict --metadata --restructuredtext
    check-manifest {toxinidir}

[testenv:coveralls]
deps =
    coveralls
skip_install = true
commands =
    coveralls []

[testenv:codecov]
deps =
    codecov
skip_install = true
commands =
    coverage xml --ignore-errors
    codecov []


[testenv:report]
deps = coverage
skip_install = true
commands =
    coverage combine --append
    coverage report
    coverage html

[testenv:clean]
commands = coverage erase
skip_install = true
deps = coverage
