b014dbe64c
The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Update local hacking checks for new flake8. Change-Id: I41a5518f1210c9a1b6d5217bbbcd99bbaa3c9b53
101 lines
2.8 KiB
INI
101 lines
2.8 KiB
INI
[tox]
|
|
minversion = 3.1.0
|
|
skipsdist = True
|
|
envlist = py36,py37,pep8
|
|
ignore_basepython_conflict = True
|
|
|
|
[testenv]
|
|
basepython = python3
|
|
whitelist_externals = rm
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
|
usedevelop = True
|
|
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
/usr/bin/find . -type f -name "*.py[co]" -delete
|
|
rm -f .testrepository/times.dbm
|
|
stestr run {posargs}
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8 {posargs} cloudkitty
|
|
doc8 {posargs}
|
|
|
|
[testenv:bandit]
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
commands = bandit -r cloudkitty -n5 -x cloudkitty/tests/* -ll
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHON=coverage run --source cloudkitty --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report
|
|
|
|
[testenv:genconfig]
|
|
commands =
|
|
oslo-config-generator --config-file etc/oslo-config-generator/cloudkitty.conf
|
|
|
|
[testenv:genpolicy]
|
|
commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/cloudkitty.conf
|
|
|
|
[testenv:docs]
|
|
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
|
|
|
|
# TODO(smcginnis) Temporarily disabling this as it fails. Error is that
|
|
# something is too large, likely from pulling in one of the conf sample files
|
|
# [testenv:pdf-docs]
|
|
# envdir = {toxworkdir}/docs
|
|
# whitelist_externals =
|
|
# make
|
|
# commands =
|
|
# sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
|
|
# make -C doc/build/pdf
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
filename = *.py,app.wsgi
|
|
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
|
|
|
|
[doc8]
|
|
ignore-path = .venv,.git,.tox,.tmp,*cloudkitty/locale*,*lib/python*,cloudkitty.egg*,doc/build,releasenotes/*
|
|
|
|
[hacking]
|
|
import_exceptions = cloudkitty.i18n
|
|
|
|
[flake8:local-plugins]
|
|
extension =
|
|
C310 = checks:CheckLoggingFormatArgs
|
|
C311 = checks:validate_assertIsNone
|
|
C312 = checks:validate_assertTrue
|
|
C313 = checks:no_translate_logs
|
|
C314 = checks:CheckForStrUnicodeExc
|
|
C315 = checks:CheckForTransAdd
|
|
C317 = checks:check_oslo_namespace_imports
|
|
C318 = checks:dict_constructor_with_list_copy
|
|
C319 = checks:no_xrange
|
|
C320 = checks:no_log_warn_check
|
|
C321 = checks:check_explicit_underscore_import
|
|
paths = ./cloudkitty/hacking
|
|
|
|
[testenv:releasenotes]
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:lower-constraints]
|
|
deps =
|
|
-c{toxinidir}/lower-constraints.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|