9350d8fb83
The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found by updated hacking version. Update local hacking checks to work with current flake8. Remove hacking and friends from lower-constraints, they are not needed there. Change-Id: I89695a03791c2de36ab015b3831c85887b27f3b8
156 lines
4.8 KiB
INI
156 lines
4.8 KiB
INI
[tox]
|
|
minversion = 3.1.1
|
|
envlist = pep8,py36,py37
|
|
skipsdist = True
|
|
ignore_basepython_conflict = True
|
|
|
|
[testenv]
|
|
basepython = python3
|
|
usedevelop = True
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
LANGUAGE=en_US
|
|
LC_ALL=en_US.utf-8
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
whitelist_externals = bash
|
|
find
|
|
rm
|
|
env
|
|
# By default stestr will set concurrency
|
|
# to ncpu, to specify something else use
|
|
# the concurrency=<n> option.
|
|
# call ie: 'tox -epy27 -- --concurrency=4'
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEBUG GENERATE_HASHES
|
|
|
|
[testenv:py36]
|
|
basepython = python3.6
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
|
|
[testenv:py37]
|
|
basepython = python3.7
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr run {posargs}
|
|
|
|
[testenv:functional]
|
|
commands =
|
|
{[testenv]commands}
|
|
stestr --test-path=./masakari/tests/functional run --concurrency=1 --slowest {posargs}
|
|
|
|
[testenv:genconfig]
|
|
commands = oslo-config-generator --config-file=etc/masakari/masakari-config-generator.conf
|
|
oslo-config-generator --config-file=etc/masakari/masakari-customized-recovery-flow-config-generator.conf
|
|
|
|
[testenv:genpolicy]
|
|
commands = oslopolicy-sample-generator --config-file=etc/masakari/masakari-policy-generator.conf
|
|
|
|
[testenv:pep8]
|
|
commands = flake8 {posargs}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHON=coverage run --source masakari --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
sphinx-build -W -b html doc/source doc/build/html
|
|
|
|
[testenv:releasenotes]
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
rm -fr releasenotes/build
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:debug]
|
|
basepython = python3
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:api-ref]
|
|
# This environment is called from CI scripts to test and publish
|
|
# the API Ref to docs.openstack.org.
|
|
commands =
|
|
rm -rf api-ref/build
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
|
|
show-source = True
|
|
|
|
# The below hacking rules by default are disabled should be enabled:
|
|
# [H106] Don't put vim configuration in source files.
|
|
# [H203] Use assertIs(Not)None to check for None.
|
|
# [H904] Delay string interpolations at logging calls.
|
|
enable-extensions = H106,H203,H904
|
|
# [W504] line break after binary operator (use W503 instead)
|
|
ignore = E123,E125,E128,E731,H405,W504
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
|
|
|
[hacking]
|
|
import_exceptions = masakari.i18n
|
|
|
|
[flake8:local-plugins]
|
|
extension =
|
|
M301 = checks:no_db_session_in_public_api
|
|
M302 = checks:use_timeutils_utcnow
|
|
M303 = checks:capital_cfg_help
|
|
M305 = checks:assert_true_instance
|
|
M306 = checks:assert_equal_type
|
|
M308 = checks:no_translate_logs
|
|
M309 = checks:no_import_translation_in_tests
|
|
M310 = checks:no_setting_conf_directly_in_tests
|
|
M315 = checks:no_mutable_default_args
|
|
M316 = checks:check_explicit_underscore_import
|
|
M317 = checks:use_jsonutils
|
|
M318 = checks:assert_true_or_false_with_in
|
|
M319 = checks:assert_raises_regexp
|
|
M320 = checks:dict_constructor_with_list_copy
|
|
M321 = checks:assert_equal_in
|
|
M322 = checks:check_greenthread_spawns
|
|
M323 = checks:check_no_contextlib_nested
|
|
M324 = checks:check_config_option_in_central_place
|
|
M325 = checks:check_doubled_words
|
|
M326 = checks:check_python3_no_iteritems
|
|
M327 = checks:check_python3_no_iterkeys
|
|
M328 = checks:check_python3_no_itervalues
|
|
M329 = checks:no_os_popen
|
|
M331 = checks:no_log_warn
|
|
M332 = checks:yield_followed_by_space
|
|
M333 = checks:check_policy_registration_in_central_place
|
|
M334 = checks:check_policy_enforce
|
|
paths = ./masakari/hacking
|
|
|
|
[testenv:lower-constraints]
|
|
deps =
|
|
-c{toxinidir}/lower-constraints.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[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
|