[tox]
minversion = 1.6
envlist = py27,py34,pep8
skipsdist = True

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
   VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --coverage --slowest --testr-args='{posargs}'
          coverage combine
          coverage report -m
          coverage erase

[testenv:linters]
usedevelop = False
deps = {[testenv]deps}
       .
commands = flake8 {posargs} bandit

[testenv:pep8]
commands = flake8 {posargs} bandit

[testenv:venv]
commands = {posargs}

[testenv:cover]
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = python setup.py testr --coverage --testr-args='{posargs}'

[testenv:openstack_coverage]
deps = PyYAML>=3.1.0
       requests>=2.7.0
commands = python tools/openstack_coverage.py

[testenv:integration]
passenv = REPO_ROOT
whitelist_externals = bash
commands = bash scripts/integration-test.sh {posargs}

[testenv:docs]
commands=
    python setup.py build_sphinx

[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# H303 no wild card imports
# F403 unable to detect undefined names
# H104 file contains nothing but comments
# H302 import only modules

show-source = True
ignore = E123,E125,H303,F403,H104,H302
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
