[tox]
envlist = py36, py37, flake8, docs, coverage, benchmark, sh

[travis]
python =
    3.7: py37
    3.6: py36

[flake8]
max-line-length = 120
ignore = E121 E126 E123 E128 E133 E226 E241 E242 E704 W291 W293 W391 W503 W504 W505

[testenv:flake8]
basepython = python
deps = flake8
commands = flake8 flatland tests examples benchmarks

[testenv:docs]
basepython = python
whitelist_externals = make
passenv =
    DISPLAY
commands = make docs

[testenv:coverage]
basepython = python
whitelist_externals = make
passenv =
    DISPLAY
commands =
    pip install -U pip
    pip install -r requirements_dev.txt
    make coverage

[testenv:benchmark]
basepython = python
setenv =
    PYTHONPATH = {toxinidir}
passenv =
    DISPLAY
whitelist_externals = sh
commands =
    sh -c 'ls benchmarks/*.py  | xargs -n 1 python'

[testenv]
whitelist_externals = sh
                      pip
setenv =
    PYTHONPATH = {toxinidir}
passenv =
    DISPLAY
deps =
    -r{toxinidir}/requirements_dev.txt
; If you want to make tox run the tests with the same versions, create a
; requirements.txt with the pinned versions and uncomment the following line:
;     -r{toxinidir}/requirements.txt
commands =
    pip install -U pip
    pip install -r requirements_dev.txt
    sh -c 'echo DISPLAY: $DISPLAY'
    py.test --basetemp={envtmpdir}