2014-05-30 17:08:19 +02:00
|
|
|
[tox]
|
2021-05-31 09:42:29 +08:00
|
|
|
minversion = 3.18.0
|
2021-04-20 02:39:05 +00:00
|
|
|
envlist = py3,pep8
|
2020-02-06 19:36:55 +01:00
|
|
|
ignore_basepython_conflict = True
|
2014-05-30 17:08:19 +02:00
|
|
|
|
|
|
|
[testenv]
|
2019-11-15 02:43:07 +00:00
|
|
|
basepython = python3
|
2023-01-09 09:30:59 -03:00
|
|
|
allowlist_externals =
|
|
|
|
find
|
|
|
|
rm
|
2014-05-30 17:08:19 +02:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2016-10-26 13:41:23 +05:30
|
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
2014-05-30 17:08:19 +02:00
|
|
|
usedevelop = True
|
|
|
|
|
2020-02-06 19:36:55 +01:00
|
|
|
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
|
|
-r{toxinidir}/requirements.txt
|
2014-05-30 17:08:19 +02:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2020-02-06 19:36:55 +01:00
|
|
|
|
2014-05-30 17:08:19 +02:00
|
|
|
commands =
|
2023-01-09 09:30:59 -03:00
|
|
|
find . -type f -name "*.py[co]" -delete
|
2017-04-26 11:56:48 +05:30
|
|
|
rm -f .testrepository/times.dbm
|
2018-07-10 15:01:15 +07:00
|
|
|
stestr run {posargs}
|
2014-05-30 17:08:19 +02:00
|
|
|
|
2017-01-15 14:48:30 +08:00
|
|
|
[testenv:debug]
|
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2014-05-30 17:08:19 +02:00
|
|
|
[testenv:pep8]
|
|
|
|
commands =
|
2019-02-13 17:40:22 +01:00
|
|
|
flake8 {posargs} cloudkitty
|
|
|
|
doc8 {posargs}
|
|
|
|
|
|
|
|
[testenv:bandit]
|
|
|
|
deps = -r{toxinidir}/test-requirements.txt
|
2019-05-13 16:57:01 +02:00
|
|
|
commands = bandit -r cloudkitty -n5 -x cloudkitty/tests/* -ll
|
2014-08-07 19:43:44 +02:00
|
|
|
|
2014-11-19 10:45:52 +01:00
|
|
|
[testenv:cover]
|
2018-07-10 15:01:15 +07:00
|
|
|
setenv =
|
|
|
|
VIRTUAL_ENV={envdir}
|
2018-09-07 12:20:52 +02:00
|
|
|
PYTHON=coverage run --source cloudkitty --parallel-mode
|
2014-11-19 10:45:52 +01:00
|
|
|
commands =
|
2018-10-09 09:59:13 +07:00
|
|
|
stestr run {posargs}
|
2018-07-10 15:01:15 +07:00
|
|
|
coverage combine
|
|
|
|
coverage html -d cover
|
|
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
coverage report
|
2014-11-19 10:45:52 +01:00
|
|
|
|
|
|
|
[testenv:genconfig]
|
|
|
|
commands =
|
2015-03-06 17:44:51 +01:00
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/cloudkitty.conf
|
2014-11-19 10:45:52 +01:00
|
|
|
|
2017-09-05 17:52:45 +08:00
|
|
|
[testenv:genpolicy]
|
|
|
|
commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/cloudkitty.conf
|
|
|
|
|
2014-08-07 19:43:44 +02:00
|
|
|
[testenv:docs]
|
2021-01-05 13:58:12 +01:00
|
|
|
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2022-10-03 16:34:02 +02:00
|
|
|
-r{toxinidir}/requirements.txt
|
2021-01-05 13:58:12 +01:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2019-10-24 20:45:38 +08:00
|
|
|
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
|
2014-05-30 17:08:19 +02:00
|
|
|
|
2020-05-02 07:23:27 -05:00
|
|
|
# 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
|
2021-05-31 09:42:29 +08:00
|
|
|
# allowlist_externals =
|
2020-05-02 07:23:27 -05:00
|
|
|
# make
|
|
|
|
# commands =
|
|
|
|
# sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
|
|
|
|
# make -C doc/build/pdf
|
2019-09-11 11:49:23 +02:00
|
|
|
|
2022-12-14 12:13:12 +00:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
|
|
|
# the API Ref to docs.openstack.org.
|
|
|
|
deps = -r{toxinidir}/doc/requirements.txt
|
|
|
|
allowlist_externals = rm
|
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2014-05-30 17:08:19 +02:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
|
|
|
[flake8]
|
2017-11-21 08:59:26 +05:30
|
|
|
filename = *.py,app.wsgi
|
2016-10-21 16:54:24 +05:30
|
|
|
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
|
2014-10-06 15:30:22 +02:00
|
|
|
|
2018-07-12 16:05:25 +07:00
|
|
|
[doc8]
|
|
|
|
ignore-path = .venv,.git,.tox,.tmp,*cloudkitty/locale*,*lib/python*,cloudkitty.egg*,doc/build,releasenotes/*
|
|
|
|
|
2014-10-06 15:30:22 +02:00
|
|
|
[hacking]
|
|
|
|
import_exceptions = cloudkitty.i18n
|
2020-03-31 16:32:26 +02:00
|
|
|
|
|
|
|
[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
|
2022-06-27 00:15:26 +09:00
|
|
|
C322 = checks:assert_raises_regexp
|
2020-03-31 16:32:26 +02:00
|
|
|
paths = ./cloudkitty/hacking
|
2016-10-21 16:54:24 +05:30
|
|
|
|
|
|
|
[testenv:releasenotes]
|
2021-01-05 13:58:12 +01:00
|
|
|
deps = {[testenv:docs]deps}
|
2019-10-24 20:45:38 +08:00
|
|
|
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
|