[tox]
minversion = {{dependencies['tox']}}
envlist =
    flake8, mypy, pylint, black
    py{{'{'}}{{",".join(py_versions).replace(".","")}}{{'}'}},

[default]
basepython=python{{py_versions[-1]}}

[testenv]
description = run test
basepython =
{%- for py_version in py_versions %}
    py{{"".join(py_version.split("."))}}: python{{py_version}}
{%- endfor %}
deps = -rrequirements-dev.txt
commands = pytest

[pytest]
addopts = --doctest-modules --doctest-ignore-import-errors
testpaths = tests {{name}} README.rst
markers = slow: marks tests as slow (deselect with '-m "not slow"')

[testenv:flake8]
description = run flake8 (linter)
basepython = {[default]basepython}
skip_install = True
deps = -rrequirements-dev.txt
commands =
    flake8 --isort-show-traceback {{name}}

[testenv:pylint]
description = run pylint (static code analysis)
basepython = {[default]basepython}
deps = -rrequirements-dev.txt
commands = pylint {{name}}

[testenv:mypy]
description = run mypy (static type checker)
basepython = {[default]basepython}
deps = -rrequirements-dev.txt
commands = mypy

[testenv:black]
description = check that comply with autoformating
basepython = {[default]basepython}
deps = -rrequirements-dev.txt
commands = black --check --diff .
