# 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 =
    {py27,py34,py35,pypy,pypy3}-{scanning,noscanning},
    flake8,
    isort,
    docs

[testenv]
basepython =
    py27: python2.7
    py34: python3.4
    py35: python3.5
    pypy: pypy
    pypy3: pypy3
deps =
    nose
    coverage
commands =
    scanning: pip install wiring[scanning]
    py27: {envpython} setup.py nosetests --tests=tests/all []
    py34: {envpython} setup.py nosetests --tests=tests/all,tests/py3 []
    py35: {envpython} setup.py nosetests --tests=tests/all,tests/py3 []
    pypy: {envpython} setup.py nosetests --tests=tests/all []
    pypy3: {envpython} setup.py nosetests --tests=tests/all,tests/py3 []
    scanning: {envpython} setup.py nosetests --tests=tests/scanning []

[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 wiring tests

[testenv:isort]
basepython = python
deps = isort
commands = isort --check-only --recursive wiring tests

[testenv:docs]
basepython = python
deps =
    sphinx
    sphinx_rtd_theme
changedir = docs
commands =
    pip install wiring[scanning]
    sphinx-build -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
