os-brick/tox.ini
zhangboye edbbe7d207 Replace deprecated UPPER_CONSTRAINTS_FILE variable
Change-Id: I4f3511374e0c558351bdc1099c68eecd82926bb0
2020-12-03 14:07:38 +08:00

140 lines
4.0 KiB
INI

[tox]
minversion = 3.1.0
skipsdist = True
skip_missing_interpreters = true
# python runtimes: https://governance.openstack.org/tc/reference/runtimes/ussuri.html
envlist = py38,py36,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}
OS_TEST_PATH=./os_brick/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}/requirements.txt
-r{toxinidir}/test-requirements.txt
# By default stestr will set concurrency
# to ncpu, to specify something else use
# the concurrency=<n> option.
# call example: 'tox -epy37 -- --concurrency=4'
commands =
stestr run {posargs}
stestr slowest
whitelist_externals = bash
find
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:debug]
commands =
find . -type f -name "*.pyc" -delete
oslo_debug_helper {posargs}
[testenv:pep8]
commands =
flake8 {posargs} .
doc8
[testenv:fast8]
envdir = {toxworkdir}/pep8
commands =
{toxinidir}/tools/fast8.sh
[testenv:pylint]
deps =
-c{env:UPPER_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 os_brick --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage/xml
[testenv:docs]
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -fr doc/build doc/source/contributor/api/ .autogenerated
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
whitelist_externals = rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
commands = {[testenv:docs]commands}
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
whitelist_externals =
make
[testenv:releasenotes]
deps = {[testenv:docs]deps}
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
[doc8]
ignore-path=.tox,*.egg-info,doc/src/api,doc/source/drivers.rst,doc/build,.eggs/*/EGG-INFO/*.txt,doc/source/configuration/tables,./*.txt,releasenotes/build
extension=.txt,.rst,.inc
[hacking]
import_exceptions = os_brick.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 {posargs}
usedevelop = False
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt