[tox]
envlist = py27-dev,py35-dev,pep8-dev
minversion = 1.6
skipsdist = True

[testenv]
usedevelop = True
setenv = VIRTUAL_ENV={envdir}
         PYTHONWARNINGS=default::DeprecationWarning
deps =
       -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable%2Frocky}
       -r{toxinidir}/test-requirements.txt
       -r{toxinidir}/requirements.txt
       neutron>=13.0.0,<14.0.0
whitelist_externals =
  find
commands =
  stestr run {posargs}

[testenv:dev]
# run locally (not in the gate) using editable mode
# https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
# note that order is important to ensure dependencies don't override
commands =
    pip install -q -e "git+https://git.openstack.org/openstack/neutron.git@stable/rocky#egg=neutron"

[testenv:py27-dev]
commands =
  {[testenv:dev]commands}
  pip freeze
  stestr run {posargs}

[testenv:py3-dev]
basepython = python3
commands =
  {[testenv:dev]commands}
  pip freeze
  stestr run {posargs}

[testenv:pep8]
basepython = python3
commands =
  flake8
  neutron-db-manage --subproject networking-arista check_migration

[testenv:pep8-dev]
basepython = python3
commands =
  {[testenv:dev]commands}
  pip freeze
  flake8
  neutron-db-manage --subproject networking-arista check_migration

[testenv:venv]
basepython = python3
commands = {posargs}

[testenv:cover]
basepython = python3
commands =
  find networking_arista -type f -name "*.pyc" -delete
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml

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

[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

[hacking]
import_exceptions = networking_arista._i18n
