[tox]
minversion = 1.6
skipsdist = True
envlist = bashate

[testenv]
usedevelop = False
basepython = python3

[testenv:bashate]
# if you want to test out some changes you have made to bashate
# against devstack, just set BASHATE_INSTALL_PATH=/path/... to your
# modified bashate tree
deps =
   {env:BASHATE_INSTALL_PATH:bashate==2.0.0}
whitelist_externals = bash
commands = bash -c "find {toxinidir}             \
         -not \( -type d -name .?\* -prune \)    \
         -not \( -type d -name doc -prune \)     \
         -not \( -type f -name localrc -prune \) \
         -type f                                 \
         -not -name \*~                          \
         -not -name \*.md                        \
         -not -name stack-screenrc               \
         -not -name \*.orig                      \
         -not -name \*.rej                       \
         \(                                      \
          -name \*.sh -or                        \
          -name \*rc -or                         \
          -name functions\* -or                  \
          -wholename \*/inc/\* -or               \
          -wholename \*/lib/\*                   \
         \)                                      \
         -print0 | xargs -0 bashate -v -iE006 -eE005,E042"

[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
whitelist_externals = bash
setenv =
  TOP_DIR={toxinidir}
commands =
  sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html

[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals =
   make
commands =
   sphinx-build -W -b latex doc/source doc/build/pdf
   make -C doc/build/pdf

[testenv:venv]
deps = -r{toxinidir}/doc/requirements.txt
commands = {posargs}