f56f42dcd8
Add a CI job to run tests on Python 3.10, which is supported in 2023.2 [0]. As rbd-iscsi-client is on an independent release model, it still supports Python 3.8, so adjust .zuul.yaml and tox.ini to use the 2023.1 upper constraints when running py38 tests. [0] https://governance.openstack.org/tc/reference/runtimes/2023.2.html Change-Id: I7fa0189dac8d980aa4fd5a7c8bac2f6f84ceb6d5
158 lines
4.8 KiB
INI
158 lines
4.8 KiB
INI
[tox]
|
|
minversion = 3.18.0
|
|
# specify virtualenv here to keep local runs consistent with the
|
|
# gate (it sets the versions of pip, setuptools, and wheel)
|
|
requires = virtualenv>=20.17.1
|
|
envlist = py3,pep8
|
|
# 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:py{36,37}]
|
|
# The last openstack release to support python 3.6 and 3.7 is yoga, so we
|
|
# need to use the yoga upper constraints
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/yoga}
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[testenv:py38]
|
|
# The last openstack release to support python 3.8 is 2023.1 (Antelope)
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2023.1}
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[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
|
|
allowlist_externals =
|
|
{toxinidir}/tools/fast8.sh
|
|
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.
|
|
# G200 Logging statements should not include the exception
|
|
# reason: Many existing cases of this that may be legitimate
|
|
#
|
|
show-source = True
|
|
ignore = E251,W503,W504,G200
|
|
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
|
|
skip_install = True
|
|
deps = bindep
|
|
commands = bindep test
|
|
usedevelop = False
|