venus/tox.ini
songwenping 4fa99dd51d Enable fast8 check
Fast8 only check these files that changed, which is more efficient for tox test.

Change-Id: I9a9816e12361900261fa2ee693bf211154eb2e0f
2021-12-28 09:13:06 +00:00

108 lines
2.9 KiB
INI

[tox]
minversion = 1.6
skipsdist = True
envlist = py39,pep8
[testenv]
basepython = python3
# Note the hash seed is set to 0 until venus can be tested with a
# random hash seed successfully.
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=venus/tests/unit
usedevelop = True
allowlist_externals =
bash
find
rm
env
make
install_command = pip install {opts} {packages}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = rm -f .testrepository/times.dbm
stestr run --slowest {posargs}
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
commands =
flake8 {posargs} . venus/common
# Check that .po and .pot files are valid:
doc8 --ignore D001 doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
[testenv:fast8]
description =
Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
envdir = {toxworkdir}/shared
commands =
bash tools/flake8wrap.sh -HEAD
[testenv:venv]
commands = {posargs}
[testenv:cover]
setenv =
PYTHON=coverage run --source cyborg --parallel-mode
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[doc8]
ignore-path = .venv,.git,.tox,*venus/locale*,*lib/python*,*venus.egg*,api-ref/build,doc/build,doc/source/contributor/api
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build/html
sphinx-build -W -b html doc/source doc/build/html
[flake8]
# Following checks are ignored on purpose.
#
# E251 unexpected spaces around keyword / parameter equals
# reason: no improvement in readability
#
# Due to the upgrade to hacking 0.9.2 the following checking are
# ignored on purpose for the moment and should be re-enabled.
#
# H405
# Due to the upgrade to hacking 0.10.0 the following checking are
# ignored on purpose for the moment and should be cleaned up and re-enabled.
#
# H105 Don't use author tags
#
filename = *.py,app.wsgi
show-source = True
ignore = E123,E125,H405,W503,W504,E251,H105,W605
builtins = _
enable-extensions = H106,H203,H904
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,*sqlalchemy/alembic/versions/*,demo/,releasenotes
[flake8:local-plugins]
extension =
M302 = checks:assert_equal_not_none
M310 = checks:use_timeutils_utcnow
M316 = checks:assert_true_isinstance
M322 = checks:no_mutable_default_args
M336 = checks:dict_constructor_with_list_copy
M338 = checks:assert_equal_in
M339 = checks:no_xrange
M340 = checks:check_explicit_underscore_import
M352 = checks:no_log_warn
N366 = checks:import_stock_mock
paths = ./venus/hacking
[hacking]
local-check-factory = venus.hacking.checks.factory
import_exceptions = venus.i18n