[tox]
minversion = 4.28.0
envlist = py3,pep8

[testenv]
constraints =
  {env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
  -r{toxinidir}/test-requirements.txt
  -r{toxinidir}/requirements.txt
commands = stestr run --slowest {posargs}

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

[testenv:docs]
deps =
  -r{toxinidir}/doc/requirements.txt
allowlist_externals =
  rm
commands =
  rm -rf doc/build/html doc/build/doctrees
  sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html

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

[testenv:venv]
commands = {posargs}

[testenv:debug]
commands = oslo_debug_helper {posargs}

[flake8]
# We only enable the hacking (H) checks
select = H
ignore = H301,H403,H404,H405
show-source = true
exclude = .tox,dist,doc,*.egg,build
