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

[testenv]
usedevelop = True
install_command = pip install -U {opts} {packages}
whitelist_externals = bash
                      find
                      rm
setenv =
   VIRTUAL_ENV={envdir}
   OS_TEST_PATH=./ooi/tests/unit
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = 
  find . -type f -name "*.pyc" -delete
  python setup.py testr --slowest --testr-args='{posargs}'

[testenv:functional]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
       OS_TEST_PATH=./ooi/tests/functional
       LANGUAGE=en_US
commands =
  find . -type f -name "*.pyc" -delete
  python setup.py testr --slowest --testr-args='{posargs}'


[testenv:pep8]
commands = 
  flake8
  # Run security linter
  # B110: except: pass
  # B410: importing etree
  bandit -r ooi -x tests -s B110,B410

[testenv:bandit]
# NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove.
commands = bandit -r ooi -x tests -s B110,B410

[testenv:venv]
commands = {posargs}

[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'

[testenv:coveralls]
commands = python setup.py testr --coverage --testr-args='{posargs}'
           coveralls
deps = coveralls
       {[testenv]deps}

[testenv:docs]
commands = rm -rf doc/source/api doc/build 
           python setup.py build_sphinx

[testenv:genconfig]
commands = oslo-config-generator --output-file etc/ooi.conf.sample \
                                 --namespace ooi --wrap-width 79

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

show-source = True
ignore = E123,E125,H803
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
