[tox]
envlist = py35,py27,pep8
minversion = 1.8
skipsdist = True

[testenv]
# Note the hash seed is set to 0 until neutron can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
         PYTHONHASHSEED=0
usedevelop = True
install_command =
    {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
       -egit+https://github.com/openstack/neutron@stable/pike#egg=neutron
whitelist_externals = bash
commands =
  bash tools/pretty_tox.sh '{posargs}'

[testenv:hashtest]
# This is the same as default environment, but with a random PYTHONHASHSEED.
# You can also specify a specific hashseed (for test repeatability) as follows:
#   tox --hashseed 1235130571 -e hashtest
setenv = VIRTUAL_ENV={envdir}

[testenv:functional]
setenv = OS_TEST_PATH=./networking_powervm/tests/functional
commands =
  python -m neutron.openstack.common.lockutils python setup.py testr --slowest --testr-args='{posargs}'

[testenv:dsvm-functional]
setenv = OS_TEST_PATH=./networking_powervm/tests/functional
         OS_SUDO_TESTING=1
         OS_ROOTWRAP_CMD=sudo /usr/local/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
         OS_FAIL_ON_MISSING_DEPS=1
sitepackages=True
commands =
  python -m neutron.openstack.common.lockutils python setup.py testr --slowest --testr-args='{posargs}'

[tox:jenkins]
sitepackages = True

[testenv:pep8]
commands = flake8

[testenv:i18n]
commands = python ./tools/check_i18n.py ./neutron ./tools/i18n_cfg.py

[testenv:cover]
commands =
  python -m neutron.openstack.common.lockutils python setup.py testr --coverage --testr-args='{posargs}'

[testenv:venv]
commands = {posargs}

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

[testenv:bashate]
commands =
  bash -c "ls devstack/*.sh | xargs bashate -v {posargs}"
whitelist_externals = bash

[flake8]
# N530 direct neutron imports not allowed
ignore = N530
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios

[hacking]
local-check-factory = networking_powervm.hacking.checks.factory
