35a9b57f91
The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found by updated hacking version. Remove hacking and friends from lower-constraints, they are not needed there at all. Align lower-constraints for new pip [1] Fix flake8 E305 and E117 and set W504 as ignored [1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019285.html Change-Id: Idae87291f4556eee77d40ab49f0d151435d70875
101 lines
2.6 KiB
INI
101 lines
2.6 KiB
INI
[tox]
|
|
envlist = py38,pep8,cover
|
|
minversion = 2.7
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
basepython = python3
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
OS_TEST_PATH=tests
|
|
passenv =
|
|
*_proxy
|
|
*_PROXY
|
|
usedevelop = True
|
|
install_command = pip install {opts} {packages}
|
|
whitelist_externals = bash
|
|
find
|
|
rm
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
.[jira_plugin]
|
|
commands =
|
|
find . -type f -name "*.pyc" -delete
|
|
stestr run {posargs}
|
|
|
|
[testenv:cover]
|
|
description = Calculates code coverage
|
|
setenv =
|
|
PYTHON=coverage run --source monasca_notification --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:debug]
|
|
commands =
|
|
oslo_debug_helper -t ./monasca_notification/tests {posargs}
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
{[testenv:flake8]commands}
|
|
{[testenv:bandit]commands}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:flake8]
|
|
commands =
|
|
flake8 monasca_notification
|
|
flake8 tests
|
|
|
|
[testenv:bandit]
|
|
commands =
|
|
bandit -r monasca_notification -n5 -x monasca_notification/tests
|
|
|
|
[testenv:genconfig]
|
|
description = Generates an example of monasca-notification configuration file
|
|
commands = oslo-config-generator \
|
|
--config-file={toxinidir}/config-generator/notification.conf
|
|
|
|
[flake8]
|
|
max-line-length = 100
|
|
# TODO: ignored checks should be enabled in the future
|
|
# H201 no 'except:' at least use 'except Exception:'
|
|
# H202: assertRaises Exception too broad
|
|
# H405 multi line docstring summary not separated with an empty line
|
|
# W504 line break occurred after a binary operator
|
|
ignore = F821,H201,H202,H405,W504
|
|
exclude=.venv,.git,.tox,dist,*egg,build
|
|
|
|
[hacking]
|
|
import_exceptions =
|
|
six.moves
|
|
|
|
[testenv:lower-constraints]
|
|
deps =
|
|
-c{toxinidir}/lower-constraints.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
.[jira_plugin]
|
|
|
|
[testenv:releasenotes]
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html \
|
|
releasenotes/source releasenotes/build/html
|
|
|
|
[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
|