zun/tox.ini
Ngo Quoc Cuong 5904cc2457 Enable H904 check
H904  String interpolation should be delayed to be handled by the
logging code, rather than being done at the point of the logging call.
Use ',' instead of '%'.

See: https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages

Related-Bug: #1596829
Change-Id: If986ca58517876d65e04b5e63ba8bb0c19793f01
2017-07-09 21:52:03 -04:00

95 lines
2.5 KiB
INI

[tox]
minversion = 2.0
envlist = py35,py27,pep8,migration
skipsdist = True
[testenv]
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
whitelist_externals = bash
find
rm
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.py[c|o]" -delete
rm -rf .testrepository/times.dbm
bash tools/pretty_tox.sh '{posargs}'
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8]
commands =
doc8 -e .rst doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
bash tools/flake8wrap.sh {posargs}
# The following bandit tests are being skipped:
# B303 - Use of insecure MD2, MD4, or MD5 hash function.
bandit -r zun -x tests -n5 -ll --skip B303
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands = {toxinidir}/tools/cover.sh {posargs}
[testenv:docs]
commands =
doc8 -e .rst specs/ doc/source/ CONTRIBUTING.rst HACKING.rst README.rst
python setup.py build_sphinx
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:debug-py27]
basepython = python2.7
commands = oslo_debug_helper {posargs}
[testenv:debug-py35]
basepython = python3.5
commands = oslo_debug_helper {posargs}
[testenv:migration]
setenv = {[testenv]setenv}
OS_TEST_PATH=./zun/tests/migration
deps = {[testenv]deps}
commands =
find . -type f -name "*.py[c|o]" -delete
bash tools/pretty_tox.sh '{posargs}'
[flake8]
show-source = True
# [H904] Delay string interpolations at logging calls.
enable-extensions = H203,H106,H904
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
[hacking]
local-check-factory = zun.hacking.checks.factory
[testenv:fast8]
# NOTE(sheel.rana): `tox -e fast8` cab be used to run pep8 command only for
# updated code instead for running whole code base.
# Use same environment directory as pep8 env to save space and install time.
envdir = {toxworkdir}/pep8
commands =
{toxinidir}/tools/fast8.sh
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:genconfig]
envdir = {toxworkdir}/venv
commands =
oslo-config-generator --config-file etc/zun/zun-config-generator.conf
[testenv:api-ref]
commands =
rm -rf api-ref/build
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html