[tox] minversion = 3.18.0 envlist = py3,pep8 [testenv] usedevelop = True allowlist_externals = rm env make setenv = OS_TEST_PATH=cyborg/tests/unit deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} [testenv:genpolicy] sitepackages = False commands = oslopolicy-sample-generator --config-file=tools/config/cyborg-policy-generator.conf [testenv:genconfig] sitepackages = False commands = oslo-config-generator --config-file=tools/config/cyborg-config-generator.conf [testenv:bindep] # 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 (this # further relies on "tox.skipsdist = True" above). deps = bindep commands = bindep test usedevelop = False [testenv:pep8] description = Run style checks. deps = pre-commit skip_install = true commands = pre-commit run -a --show-diff-on-failure [testenv:venv] commands = {posargs} [testenv:cover] setenv = PYTHON=coverage run --source cyborg --parallel-mode commands = coverage erase stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml coverage report [doc8] ignore-path = .venv,.git,.tox,*cyborg/locale*,*lib/python*,*cyborg.egg*,api-ref/build,doc/build,doc/source/contributor/api [testenv:docs] description = Build main documentation. allowlist_externals = sphinx-build rm deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/doc/requirements.txt commands = rm -rf doc/build/html doc/build/doctrees sphinx-build -W --keep-going -b html -j auto doc/source doc/build/html [testenv:pdf-docs] description = Build PDF documentation. deps = {[testenv:docs]deps} commands = rm -rf doc/build/pdf sphinx-build -W --keep-going -b latex -j auto doc/source doc/build/pdf make -C doc/build/pdf [testenv:releasenotes] description = Generate release notes. deps = {[testenv:docs]deps} commands = rm -rf releasenotes/build sphinx-build -W --keep-going -b html -j auto releasenotes/source releasenotes/build/html [testenv:debug] commands = oslo_debug_helper -t cyborg/tests {posargs} [testenv:api-ref] description = Generate the API ref. Called from CI scripts to test and publish to docs.openstack.org. # This environment is called from CI scripts to test and publish # the API Ref to docs.openstack.org. deps = {[testenv:docs]deps} commands = rm -rf api-ref/build sphinx-build -W --keep-going -b html -j auto api-ref/source api-ref/build/html allowlist_externals = rm [flake8] # We only enable the hacking (H) checks; ruff handles everything else select = H,C # H301 ruff-I enforces one-symbol-per-line where needed # H306 ruff-I (rule I001) handles import ordering; its sort key (by # from-module path) differs from H306's (fully-qualified name), # so H306 is redundant and would produce false positives # H404 Docstrings don't always start with a newline # H405 Multiline docstrings are okay ignore = H301,H306,H404,H405 show-source = True exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,releasenotes,*sqlalchemy/alembic/versions/* [flake8:local-plugins] extension = C300 = checks:CheckSetLiteralInLogging paths = ./cyborg/hacking