[tox]
skipsdist = true
envlist = py27-{flake8,linux,windows}

[testenv:py27-linux]
platform = linux
whitelist_externals = /bin/rm
envdir = {toxworkdir}/tox
passenv = CI TRAVIS TRAVIS_*
deps =
    codecov
    nose
    rednose
    mock
    vcrpy-unittest
    pytz
    pyopenssl
commands =
    /bin/rm -f {toxinidir}/tests/sickbeard.db
    /bin/rm -f {toxinidir}/tests/cache.db
    /bin/rm -f {toxinidir}/tests/failed.db
    nosetests -c nose.cfg --nocapture
    - codecov -e TRAVIS_JOB_ID TRAVIS_BRANCH

[testenv:py27-windows]
platform = win
whitelist_externals = {env:SYSTEMROOT:C:\Windows\}\System32\cmd.exe
envdir = {toxworkdir}/tox
passenv = CI APPVEYOR APPVEYOR_* PYTHON_ARCH
deps =
    codecov
    nose
    rednose
    mock
    vcrpy-unittest
    pytz
    pyopenssl
commands =
    cmd /c del /f /q {toxinidir}\tests\sickbeard.db {toxinidir}\tests\cache.db {toxinidir}\tests\failed.db 2> nul
    nosetests -c nose.cfg --nocapture
    - codecov -e APPVEYOR_REPO_BRANCH PYTHON_ARCH

[testenv:py27-flake8]
envdir = {toxworkdir}/flake8
setenv = PATH = {toxinidir}/lib;{env:PATH:}
deps =
    flake8-coding
    isort
commands =
    flake8 --select C101,C102,C103 sickbeard sickrage tests SickBeard.py setup.py
    isort --check-only --diff --recursive sickbeard sickrage

[flake8]
accept-encodings = utf-8, latin-1