[tox]
skip_missing_interpreters = True
skipsdist=True
minversion = 1.8
envlist =
    py36,
    py37,
    docs,
    pep8,
    mypy,
    packaging

[testenv]
# This is required in order to get UTF-8 output inside of the subprocesses
# that our tests use.
setenv = LC_CTYPE = en_US.UTF-8
# Pass Display down to have it for the tests available
passenv = DISPLAY TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
whitelist_externals=convert
deps =
    pytest-cov
    xvfbwrapper
commands =
    # xcffib has to be installed before cairocffi
    pip install xcffib
    pip install -r {toxinidir}/requirements.txt
    {toxinidir}/scripts/ffibuild
    pytest --cov libqtile --cov-report term-missing {posargs}

[testenv:packaging]
deps =
    check-manifest
    twine
commands =
    check-manifest
    python setup.py check -m -s
    python setup.py sdist
    twine check dist/*

[testenv:pep8]
deps =
    flake8
    pep8-naming
commands = flake8 {toxinidir}/libqtile {toxinidir}/bin/ {toxinidir}/test

[testenv:mypy]
deps = mypy
commands = mypy -p libqtile

[testenv:docs]
deps = -r{toxinidir}/docs/requirements.txt
commands = python setup.py build_sphinx -W

[tox]
skip_missing_interpreters = True
skipsdist=True
minversion = 1.8
envlist =
    py36,
    py37,
    docs,
    pep8,
    mypy,
    packaging

[testenv]
# This is required in order to get UTF-8 output inside of the subprocesses
# that our tests use.
setenv = LC_CTYPE = en_US.UTF-8
# Pass Display down to have it for the tests available
passenv = DISPLAY TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
whitelist_externals=convert
# xcffib has to be installed before cairocffi
# xvfbwrapper has problems being installed by setuptools
deps =
    pytest-runner
    xcffib
    xvfbwrapper
commands =
    python setup.py pytest --addopts "--cov libqtile --cov-report term-missing {posargs}"

[testenv:packaging]
deps =
    check-manifest
    twine
commands =
    check-manifest
    python setup.py check -m -s
    python setup.py sdist
    twine check dist/*

[testenv:pep8]
deps =
    flake8
    pep8-naming
commands = flake8 {toxinidir}/libqtile {toxinidir}/bin/ {toxinidir}/test

[testenv:mypy]
deps = mypy
commands = mypy -p libqtile

[testenv:docs]
deps = -r{toxinidir}/docs/requirements.txt
commands = python setup.py build_sphinx -W

Use pytest runner to run unit tests
Use pytest runner to run unit tests

All of the tests can be run through an environment configured with
setuptools.  This has the advantage of also ensuring that the setup.cfg
is properly configured to allow us to run all of the tests.
