rbd-iscsi-client/tox.ini

139 lines
4.3 KiB
INI

[tox]
minversion = 3.18.0
requires = virtualenv>=20.4.2
# python runtimes: https://governance.openstack.org/tc/reference/project-testing-interface.html#tested-runtimes
envlist = py3,pep8
skipsdist = True
# this allows tox to infer the base python from the environment name
# and override any basepython configured in this file
ignore_basepython_conflict=true
[testenv]
basepython = python3
usedevelop = True
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_TEST_PATH=./rbd_iscsi_client/tests
OS_TEST_TIMEOUT=60
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands =
find . -ignore_readdir_race -type f -name "*.pyc" -delete
stestr run {posargs}
stestr slowest
allowlist_externals = bash
find
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8]
commands = flake8 {posargs}
[testenv:debug]
commands =
find . type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
[testenv:fast8]
# Use same environment directory as pep8 env to save space and install time
envdir = {toxworkdir}/pep8
commands =
{toxinidir}/tools/fast8.sh
[testenv:pylint]
# FIXME:
# 1. pylint uses logilab.astng.rebuilder, and under py3.8 it gives this
# error: ImportError: cannot import name 'Str' from '_ast'
# 2. pylint is pinned really low because tools/lintstack.py uses an option
# '--include-ids=y' that was removed from pylint at some point
# 3. even so, this still doesn't work ... problem generating the
# tools/pylint_exceptions file that's used to translate from codes
# to messages
basepython = python3.6
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
pylint==0.26.0
commands = bash tools/lintstack.sh
[testenv:venv]
commands = {posargs}
[testenv:cover]
# To see the report of missing coverage add to commands
# coverage report --show-missing
setenv =
{[testenv]setenv}
PYTHON=coverage run --source rbd_iscsi_client --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage/xml
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
doc8
rm -rf doc/build .autogenerated doc/source/api
sphinx-build -W -b html doc/source doc/build/html
allowlist_externals = rm
[doc8]
ignore-path=.tox,*.egg-info,doc/build,.eggs/*/EGG-INFO/*.txt
extension=.txt,.rst
[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]
# Following checks are ignored on purpose.
#
# E251 unexpected spaces around keyword / parameter equals
# reason: no improvement in readability
# W503 line break before binary operator
# reason: pep8 itself is not sure about this one and
# reversed this rule in 2016
# W504 line break after binary operator
# reason: no agreement on this being universally
# preferable for our code. Disabled to keep checking
# tools from getting in our way with regards to this.
#
show-source = True
ignore = E251,W503,W504
enable-extensions=H106,H203,H204,H205
builtins = _
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build
max-complexity=30
[hacking]
import_exceptions = rbd_iscsi_client.i18n
[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:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt