You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
5.5 KiB

minversion = 3.18.0
envlist = py39,pep8,api-ref,docs,genconfig,genpolicy,releasenotes,protection
ignore_basepython_conflict = true
basepython = python3
usedevelop = True
setenv =
deps =
commands =
find keystone -type f -name "*.pyc" -delete
stestr run {posargs}
allowlist_externals =
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY,PBR_VERSION
deps =
commands =
# Run bash8 during pep8 runs to ensure violations are caught by
# the check and gate queues
bashate devstack/
# Run security linter
bandit -r keystone -x 'keystone/tests/*'
envdir = {toxworkdir}/pep8
deps = {[testenv:pep8]deps}
commands =
# NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove.
deps =
commands = bandit -r keystone -x 'keystone/tests/*'
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv =
PYTHON=coverage run --source keystone --parallel-mode
commands =
find keystone -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
commands =
bash tools/
commands = {posargs}
commands =
find keystone -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
passenv = KSTEST_*
deps =
setenv = OS_TEST_PATH=./keystone/tests/functional
commands =
find keystone -type f -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
passenv = KSTEST_*
filename= *.py,keystone-manage
show-source = true
enable-extensions = H203,H904
# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D106: Missing docstring in public nested class
# D107: Missing docstring in __init__
# D203: 1 blank line required before class docstring (deprecated in pep257)
# D401: First line should be in imperative mood; try rephrasing
# TODO(wxy): Fix the pep8 issue.
# E305:
# E402: module level import not at top of file
# H211: Use assert{Is,IsNot}instance
# H214: Use assertIn/NotIn(A, B) rather than assertTrue/False(A in/not in B) when checking collection contents.
# W503: line break before binary operator
# W504: line break after binary operator
# W605:
ignore = D100,D101,D102,D103,D104,D106,D107,D203,D401,E305,E402,H211,H214,W503,W504,W605
exclude = .venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity = 24
deps =
bash -c "rm -rf doc/build"
bash -c "rm -rf doc/source/api"
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
# FIXME(gyee): we need to pre-create the doc/build/pdf/_static directory as a
# workaround because sphinx_feature_classification.support_matrix extension
# is operating under the assumption that the _static directory already exist
# and trying to copy support-matrix.css into it. We need to remove
# the workaround after this patch has merged:
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
allowlist_externals =
commands =
rm -rf doc/build/pdf
mkdir -p doc/build/pdf/_static
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
envdir = {toxworkdir}/docs
deps = {[testenv:docs]deps}
commands =
bash -c "rm -rf api-ref/build"
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
commands = oslo-config-generator --config-file=config-generator/keystone.conf
commands = oslopolicy-sample-generator --config-file config-generator/keystone-policy-generator.conf
import_exceptions =
extension =
K001 = checks:CheckForMutableDefaultArgs
K002 = checks:block_comments_begin_with_a_space
K005 = checks:CheckForTranslationIssues
K008 = checks:dict_constructor_with_sequence_copy
paths = ./keystone/tests/hacking
# 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.
deps = bindep
commands = bindep test
commands =
find keystone -type f -name "*.pyc" -delete
stestr run --test-path=./keystone/tests/protection {posargs}