160 lines
4.5 KiB

minversion = 3.18.0
envlist = py39,functional-py39,pep8
usedevelop = True
allowlist_externals =
install_command = python -I -m pip install -c{env:UPPER_CONSTRAINTS_FILE:} {opts} {packages}
setenv =
# TODO(stephenfin): Remove once we bump our upper-constraint to SQLAlchemy 2.0
deps = -r{toxinidir}/test-requirements.txt
# For a venv that doesn't use stestr commands must be overridden.
commands =
stestr run {posargs}
passenv =
# there is also secret magic in subunit-trace which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
# The functional environment is the base env for functional tests.
commands =
stestr --test-path=./placement/tests/functional run {posargs}
commands =
commands =
commands =
description =
Run style checks.
commands =
bash tools/ {posargs}
description =
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
commands =
bash tools/ -HEAD
commands =
oslo-config-generator --config-file=etc/placement/config-generator.conf
commands =
oslopolicy-sample-generator --config-file=etc/placement/policy-generator.conf
# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
# section once we rely on coverage 4.3+
setenv =
PYTHON=coverage run --source placement --parallel-mode
commands =
coverage erase
stestr --test-path=./placement/tests run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
commands =
oslo_debug_helper {posargs}
deps =
commands =
description =
Build all documentation including API guides and refs.
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html
# Test the redirects
whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
basepython = python3
deps = {[testenv:docs]deps}
allowlist_externals =
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
description =
Generate the API ref. Called from CI scripts to test and publish to
deps = {[testenv:docs]deps}
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
description =
Generate release notes.
deps = {[testenv:docs]deps}
commands =
rm -rf releasenotes/build
sphinx-build -W -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html
# NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove.
commands = bandit -r placement -x tests -n 5 -ll
enable-extensions = H106,H203,H904
# H405 is a good guideline, but sometimes multiline doc strings just don't have
# a natural summary line. Rejecting code for this reason is wrong.
# W504 skipped since you must choose either W503 or W504 (they conflict)
ignore = H405, W504
exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes
# To get a list of functions that have a complexity of 19 or more, set
# max-complexity to 19 and run 'tox -epep8'.
# 19 is currently the most complex thing we have
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files, and develop mode disabled
# explicitly to avoid unnecessarily installing the checked-out repo too
usedevelop = False
skipsdist = True
deps = bindep
commands =
bindep test