python-openstackclient/tox.ini
Stephen Finucane 0646f9b4e4 tox: Remove bandit skips, run via pre-commit
Most of these skips were unnecessary. The few that did generate warnings
could be skipped.

We also set 'skip_install' since there's no reason to build the package
for linting purposes.

Change-Id: I9644e5c19720b9c41c60e0a5882b7cd7f6a71f7b
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2024-04-26 13:17:15 +01:00

106 lines
3.3 KiB
INI

[tox]
minversion = 4.3.0
envlist = py3,pep8
[testenv]
usedevelop = true
setenv =
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
stestr run {posargs}
[testenv:pep8]
skip_install = true
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure
[testenv:bandit]
skip_install = true
deps =
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure bandit
[testenv:unit-tips]
commands =
python -m pip install -q -U -e {toxinidir}/../cliff#egg=cliff
python -m pip install -q -U -e {toxinidir}/../keystoneauth#egg=keystoneauth
python -m pip install -q -U -e {toxinidir}/../osc-lib#egg=osc_lib
python -m pip install -q -U -e {toxinidir}/../openstacksdk#egg=openstacksdk
python -m pip freeze
stestr run {posargs}
[testenv:functional{,-tips,-py38,-py39,-py310,-py311,-py312}]
setenv =
OS_TEST_PATH=./openstackclient/tests/functional
passenv =
OS_*
commands =
tips: python -m pip install -q -U -e {toxinidir}/../cliff#egg=cliff
tips: python -m pip install -q -U -e {toxinidir}/../keystoneauth#egg=keystoneauth1
tips: python -m pip install -q -U -e {toxinidir}/../osc-lib#egg=osc_lib
tips: python -m pip install -q -U -e {toxinidir}/../openstacksdk#egg=openstacksdk
tips: python -m pip freeze
{[testenv]commands}
[testenv:venv]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
{posargs}
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source openstackclient --parallel-mode
commands =
stestr -q run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:debug]
passenv =
OS_*
commands =
oslo_debug_helper -t openstackclient/tests {posargs}
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
sphinx-build -a -E -W -d doc/build/doctrees -b man doc/source doc/build/man
# Validate redirects (must be done after the docs build
whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
[testenv:releasenotes]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[flake8]
show-source = true
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,releasenotes
# E203 Black will put spaces after colons in list comprehensions
# E501 Black takes care of line length for us
# E704 Black will occasionally put multiple statements on one line
# H301 Black will put commas after imports that can't fit on one line
# W503 and W504 are disabled since they're not very useful
ignore = E203, E501, E701, H301, W503, W504
import-order-style = pep8
application_import_names = openstackclient