[tox]
envlist = py3,pep8
minversion = 4.28.0

[testenv]
usedevelop = True
constraints =
  {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2026.2}
deps =
  -r{toxinidir}/requirements.txt
  -r{toxinidir}/test-requirements.txt
commands =
  find . -type f -name "*.py[c|o]" -delete
  stestr run --slowest {posargs}
allowlist_externals = find

[testenv:debug]
commands = oslo_debug_helper -t heatclient/tests {posargs}

[testenv:pep8]
skip_install = true
deps =
  pre-commit
commands =
  pre-commit run -a

[testenv:venv]
commands = {posargs}

[testenv:functional]
setenv =
  OS_TEST_PATH = ./heatclient/tests/functional
  CLIENT_NAME=python-heatclient
passenv = OS_*

[testenv:cover]
setenv =
  PYTHON=coverage run --source heatclient --parallel-mode
commands =
  stestr run {posargs}
  coverage combine
  coverage html -d cover
  coverage xml -o cover/coverage.xml
  coverage report

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

[flake8]
show-source = True
enable-extensions = H106,H203,H204,H205,H904
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build
max-complexity=20

[hacking]
import_exceptions = heatclient._i18n

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