[tox]
minversion = 3.1
envlist = docs
skipsdist = True
ignore_basepython_conflict = True

[testenv]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
passenv = *_proxy *_PROXY

[testenv:venv]
commands = {posargs}

[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
  rm -rf doc/build
  docstheme-build-translated.sh
whitelist_externals =
  rm

[testenv:lint]
deps = yamllint
commands =
  bash -c "rm -rf {toxinidir}/.yamllint"
  bash -c "mkdir -p {toxinidir}/.yamllint"
  bash -c "cp -r $(ls {toxinidir}) {toxinidir}/.yamllint/"
  bash -c "find {toxinidir}/.yamllint -type f -exec sed -i 's/%%%.*/XXX/g' \{\} +"
  bash -c "yamllint -c {toxinidir}/yamllint.conf {toxinidir}/.yamllint/*/values* {toxinidir}/yamllint.conf"
whitelist_externals =
  bash