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

[testenv]
whitelist_externals = bash
setenv = VIRTUAL_ENV={envdir}
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/queens} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
           testr run {posargs}

[testenv:pep8]
commands = flake8

[testenv:docs]
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt
       sphinxcontrib-httpdomain
commands = python setup.py build_sphinx

[testenv:venv]
commands = {posargs}

[flake8]
show-source = True
builtins = _
exclude=.venv,.git,.tox,*lib/python*,private,.eggs

[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
