# 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,pep8
skipsdist = True

[testenv]
usedevelop = True
deps =
    pipenv
commands =
    pipenv install --dev
    py.test \
        --basetemp={envtmpdir} \
        --cov \
        --cov-report term-missing \
        --cov-report xml \
        {posargs}
setenv =
    HOME = {envtmpdir}
    PYTHONPATH = {toxinidir}

[testenv:pep8]
deps = flake8
commands = flake8 {toxinidir}

[flake8]
# H803 skipped on purpose per list discussion.
# E123, E125 skipped as they are invalid PEP-8.

show-source = True
ignore = E123,E125,H803,E501
builtins = _
exclude = build,dist,doc,legacy,.eggs,.git,.tox,.venv

[pytest]
testpaths = tests
python_functions = *_test test_*

[testenv:pip]
deps = twine
commands =
    python setup.py sdist bdist_wheel
    twine upload dist/*