# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.

[tox]
envlist = py{35,36,37,38}-{mpi,},flake8,pylint,docs,check-manifest,checkreadme

[testenv]
commands = py.test -p pytester --cov={envsitepackagesdir}/pytest_mpi --runpytest=subprocess {posargs}
deps =
    pytest
    pytest-cov
    sybil
    -c known_broken_constraints.txt
    mpi: mpi4py
basepython =
    py35: {env:TOXPYTHON:python3.5}
    py36: {env:TOXPYTHON:python3.6}
    py37: {env:TOXPYTHON:python3.7}
    py38: {env:TOXPYTHON:python3.8}
    flake8: {env:TOXPYTHON:python3}
    pylint: {env:TOXPYTHON:python3}
    docs: {env:TOXPYTHON:python3}
    check-manifest: {env:TOXPYTHON:python3}
    checkreadme: {env:TOXPYTHON:python3}

[testenv:docs]
changedir=docs
deps=-rdoc-requirements.txt
commands=
    sphinx-build -W -b html -d {envtmpdir}/doctrees .  {envtmpdir}/html

[testenv:flake8]
deps=flake8
commands=
    flake8 --exclude={envsitepackagesdir}/pytest_mpi/_version.py {envsitepackagesdir}/pytest_mpi

[testenv:pylint]
deps=pylint
commands=
    pylint {envsitepackagesdir}/pytest_mpi

[testenv:check-manifest]
deps=check-manifest
setenv = 
    CHECK_MANIFEST=true
commands=
    check-manifest

[testenv:checkreadme]
deps=readme_renderer
commands=
    python setup.py check -s -r
