[tox]
envlist = build, py34, py35, py36, lint
skip_missing_interpreters = True
skipsdist = True

[testenv]
setenv =
    LANG=en_US.UTF-8
    PYTHONPATH = {toxinidir}
commands = 
    py.test --timeout=30 --duration=10 --cov=blinkpy --cov-report term-missing {posargs}
deps = 
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/requirements_test.txt
    
[testenv:lint]
deps = 
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/requirements_test.txt
basepython = python3
ignore_errors = True
commands = 
    pylint --rcfile={toxinidir}/pylintrc blinkpy tests
    flake8 blinkpy tests
    pydocstyle blinkpy tests
    rst-lint README.rst
    rst-lint CHANGES.rst

[testenv:build]
recreate = True
skip_install = True
whitelist_externals =
    /bin/sh
    /bin/rm
deps =
    -r{toxinidir}/requirements_test.txt
commands = 
    /bin/rm -rf build dist
    python setup.py bdist_wheel
    /bin/sh -c "pip install --upgrade dist/*.whl"
    py.test tests
