octavia-lib/tox.ini
liyou01 daaef2951b Fix tox4 error
tox.ini started failing with Tox4 which had some
incompatible changes. One is passenv where we need
to pass each value in newline otherwise, it fails with
error:

 failed with pass_env values cannot contain whitespace,
 use comma to have multiple values in a single line,
 invalid values found.....

Other failure is due to the skipsdist = True.

Fixing tox.ini for tox4 changes.

Change-Id: Ib1e58d792ff12d3c3b72a001e04fa9b8c62d1ef8
2023-01-10 16:24:12 +01:00

116 lines
3.3 KiB
INI

[tox]
minversion = 3.18.0
envlist = docs,py38,pep8
ignore_basepython_conflict = True
[testenv]
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
OS_TEST_TIMEOUT=60
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 {posargs}
[testenv:pep8]
commands = flake8
doc8 --ignore-path doc/source/contributor/modules \
doc/source octavia_lib HACKING.rst README.rst
# Run security linter
bandit -r octavia_lib -ll -ii -x octavia_lib/tests
{toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
allowlist_externals =
{toxinidir}/tools/coding-checks.sh
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source octavia_lib --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --fail-under=95 --skip-covered
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
allowlist_externals =
rm
commands =
rm -rf doc/build doc/source/reference/modules
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
rm
commands =
rm -rf doc/build/pdf
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[flake8]
# W504 line break after binary operator
ignore = W504
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
# [H106]: Don't put vim configuration in source files
# [H203]: Use assertIs(Not)None to check for None
# [H204]: Use assert(Not)Equal to check for equality
# [H205]: Use assert(Greater|Less)(Equal) for comparison
# [H904]: Delay string interpolations at logging calls
enable-extensions=H106,H203,H204,H205,H904
[hacking]
import_exceptions = octavia_lib.i18n
[flake8:local-plugins]
extension =
O316 = checks:assert_true_instance
O318 = checks:assert_equal_or_not_none
O323 = checks:assert_equal_true_or_false
O324 = checks:no_mutable_default_args
O338 = checks:assert_equal_in
O339 = checks:no_log_warn
O341 = checks:no_translate_logs
O342 = checks:check_raised_localized_exceptions
O343 = checks:check_no_basestring
O345 = checks:check_no_eventlet_imports
O346 = checks:check_line_continuation_no_backslash
O348 = checks:check_no_logging_imports
O501 = checks:check_no_octavia_namespace_imports
paths =
./octavia_lib/hacking
[doc8]
max-line-length = 79
[testenv:requirements]
deps =
-egit+https://opendev.org/openstack/requirements#egg=openstack-requirements
allowlist_externals = sh
commands =
sh -c '{envdir}/src/openstack-requirements/playbooks/files/project-requirements-change.py --req {envdir}/src/openstack-requirements --local {toxinidir} master'