[tox]
minversion = 2.0
skipsdist = True
envlist = py{27,3},pep8,functional{,-py3},coverage

[testenv]
usedevelop=True
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY BRANCH
setenv =
   VIRTUAL_ENV={envdir}
deps =
    -r{toxinidir}/requirements.txt
    -r{toxinidir}/test-requirements.txt
whitelist_externals = /bin/bash

[testenv:py27]
commands =
  /bin/bash {toxinidir}/tools/run_tests.sh --unit

[testenv:py3]
basepython = python3
commands = {[testenv:py27]commands}

[testenv:pep8]
# for gate testing, scans only the files changed in the last commit
commands =
  /bin/bash tools/coding-checks.sh --pylint HEAD~ '{posargs}'

[testenv:pep8-full]
# For manual testing, scans the whole codebase
commands =
  /bin/bash tools/coding-checks.sh --pylint '{posargs}'

[testenv:coverage]
basepython = python3
commands =
  /bin/bash {toxinidir}/tools/run_tests.sh --coverage

[testenv:functional]
commands =
  /bin/bash {toxinidir}/tools/run_tests.sh --functional

[testenv:functional-py3]
basepython = python3
commands = {[testenv:functional]commands}

[testenv:os-requirements]
commands =
    python {toxinidir}/tools/os-requirements-check.py {envdir}