2013-08-08 10:34:06 -04:00
|
|
|
[tox]
|
2021-05-31 09:59:20 +08:00
|
|
|
minversion = 3.18.0
|
2014-07-16 13:23:05 +03:00
|
|
|
skipsdist = True
|
2019-10-24 17:21:34 -07:00
|
|
|
envlist = py3,pep8
|
2013-08-08 10:34:06 -04:00
|
|
|
|
|
|
|
[testenv]
|
2019-10-24 17:21:34 -07:00
|
|
|
basepython = python3
|
2013-08-08 10:34:06 -04:00
|
|
|
setenv = VIRTUAL_ENV={envdir}
|
2014-07-16 13:23:05 +03:00
|
|
|
usedevelop = True
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = find
|
2020-04-22 18:22:46 -07:00
|
|
|
deps =
|
2020-11-12 09:35:10 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2020-04-22 18:22:46 -07:00
|
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
2015-11-26 10:58:03 +09:00
|
|
|
commands =
|
2016-09-16 13:56:38 +05:30
|
|
|
find . -type f -name "*.py[c|o]" -delete
|
2018-10-09 10:12:57 +07:00
|
|
|
stestr run {posargs}
|
2018-05-09 10:34:32 +08:00
|
|
|
stestr slowest
|
2014-07-16 13:23:05 +03:00
|
|
|
|
2015-11-09 07:56:52 +01:00
|
|
|
[testenv:releasenotes]
|
2018-01-17 09:43:25 +08:00
|
|
|
deps =
|
2020-11-12 09:35:10 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-01-17 09:43:25 +08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-06-01 17:18:42 -04:00
|
|
|
commands =
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees \
|
2015-11-09 07:56:52 +01:00
|
|
|
-b html releasenotes/source releasenotes/build/html
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = rm
|
2015-11-09 07:56:52 +01:00
|
|
|
|
2016-01-10 00:38:07 +08:00
|
|
|
[testenv:debug]
|
2017-01-05 18:28:01 -05:00
|
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
|
2013-08-08 10:34:06 -04:00
|
|
|
[testenv:pep8]
|
2018-04-07 09:20:15 -04:00
|
|
|
# Let's gate pep8 under py3 by default because the py3 checks are stricter.
|
2013-08-08 10:34:06 -04:00
|
|
|
commands =
|
2014-10-19 18:56:02 +02:00
|
|
|
flake8 {posargs}
|
2015-01-13 17:33:09 +01:00
|
|
|
# Run bashate during pep8 runs to ensure violations are caught by
|
|
|
|
# the check and gate queues.
|
2016-05-23 14:52:28 -04:00
|
|
|
bashate -i E006,E042,E043 \
|
2016-02-21 10:18:58 -05:00
|
|
|
tools/enable-pre-commit-hook.sh \
|
2015-01-13 17:33:09 +01:00
|
|
|
contrib/ci/pre_test_hook.sh \
|
|
|
|
contrib/ci/post_test_hook.sh \
|
|
|
|
devstack/plugin.sh \
|
2016-04-07 16:41:59 +03:00
|
|
|
devstack/upgrade/from-mitaka/upgrade-manila \
|
|
|
|
devstack/upgrade/resources.sh \
|
|
|
|
devstack/upgrade/shutdown.sh \
|
|
|
|
devstack/upgrade/upgrade.sh \
|
2015-07-23 14:34:28 +03:00
|
|
|
tools/cover.sh \
|
2019-02-19 20:26:45 -08:00
|
|
|
tools/check_logging.sh \
|
|
|
|
tools/coding-checks.sh
|
2016-04-04 14:14:07 -04:00
|
|
|
{toxinidir}/tools/check_exec.py {toxinidir}/manila
|
2016-04-04 07:01:28 -04:00
|
|
|
{toxinidir}/tools/check_logging.sh {toxinidir}/manila
|
2013-08-08 10:34:06 -04:00
|
|
|
|
2014-04-29 14:11:52 +03:00
|
|
|
[testenv:genconfig]
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = bash
|
2014-04-29 14:11:52 +03:00
|
|
|
commands =
|
2014-10-16 21:03:03 +02:00
|
|
|
oslo-config-generator --config-file etc/oslo-config-generator/manila.conf
|
2014-04-29 14:11:52 +03:00
|
|
|
|
2017-09-25 18:41:24 +08:00
|
|
|
[testenv:genpolicy]
|
|
|
|
commands = oslopolicy-sample-generator --config-file=etc/manila/manila-policy-generator.conf
|
|
|
|
|
2013-08-08 10:34:06 -04:00
|
|
|
[testenv:venv]
|
|
|
|
commands = {posargs}
|
|
|
|
|
2014-08-21 17:03:06 +02:00
|
|
|
[testenv:docs]
|
2018-01-17 09:43:25 +08:00
|
|
|
deps =
|
2020-11-12 09:35:10 +08:00
|
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
2018-01-17 09:43:25 +08:00
|
|
|
-r{toxinidir}/doc/requirements.txt
|
2017-02-15 07:07:42 +01:00
|
|
|
commands =
|
2017-03-03 09:38:22 -05:00
|
|
|
rm -rf doc/build
|
2018-05-04 00:00:00 +08:00
|
|
|
sphinx-build -W -b html doc/source doc/build/html
|
2017-04-13 06:36:24 -04:00
|
|
|
# Ignore D001 since we allow lines in excess of 79 characters.
|
2019-02-19 23:20:26 +05:30
|
|
|
doc8 --ignore D001 --ignore-path .tox --ignore-path doc/build --ignore-path manila.egg-info -e .txt -e .rst -e .inc
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = rm
|
2014-08-21 17:03:06 +02:00
|
|
|
|
2019-08-27 14:23:45 +02:00
|
|
|
[testenv:pdf-docs]
|
|
|
|
deps = {[testenv:docs]deps}
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals =
|
2019-08-27 14:23:45 +02:00
|
|
|
make
|
|
|
|
commands =
|
|
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
|
|
make -C doc/build/pdf
|
|
|
|
|
2019-06-24 14:39:22 -07:00
|
|
|
[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
|
|
|
|
|
2013-08-08 10:34:06 -04:00
|
|
|
[testenv:cover]
|
2018-01-14 13:18:36 +08:00
|
|
|
setenv =
|
|
|
|
{[testenv]setenv}
|
|
|
|
PYTHON=coverage run --source manila --parallel-mode
|
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/cover.sh {posargs}
|
2013-08-08 10:34:06 -04:00
|
|
|
|
2016-02-21 09:14:13 -05:00
|
|
|
[testenv:fast8]
|
2018-04-07 09:20:15 -04:00
|
|
|
# Let's run fast8 under py3 by default because the py3 checks are stricter.
|
2016-02-21 09:14:13 -05:00
|
|
|
commands =
|
|
|
|
{toxinidir}/tools/fast8.sh
|
|
|
|
|
2013-08-08 10:34:06 -04:00
|
|
|
[testenv:pylint]
|
2013-09-30 10:48:26 -04:00
|
|
|
deps = -r{toxinidir}/requirements.txt
|
2019-01-24 07:38:45 -05:00
|
|
|
-r{toxinidir}/test-requirements.txt
|
2019-03-05 15:30:22 -08:00
|
|
|
pylint==2.3.1
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = bash
|
2018-10-11 15:08:16 -04:00
|
|
|
commands = bash ./tools/coding-checks.sh --pylint {posargs}
|
2013-08-08 10:34:06 -04:00
|
|
|
|
2016-05-07 17:18:15 +02:00
|
|
|
[testenv:api-ref]
|
|
|
|
# This environment is called from CI scripts to test and publish
|
2019-07-22 19:03:32 +02:00
|
|
|
# the API Ref to docs.openstack.org.
|
2020-02-23 14:12:56 +01:00
|
|
|
deps = {[testenv:docs]deps}
|
2021-05-31 09:59:20 +08:00
|
|
|
allowlist_externals = rm
|
2016-05-07 17:18:15 +02:00
|
|
|
commands =
|
|
|
|
rm -rf api-ref/build
|
2019-08-13 20:47:45 -07:00
|
|
|
python {toxinidir}/tools/validate-json-files.py {toxinidir}/api-ref/source/samples/
|
2016-05-07 17:18:15 +02:00
|
|
|
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
|
|
|
|
|
2016-06-22 13:24:35 +02:00
|
|
|
[testenv:dbrevision]
|
|
|
|
deps = -r{toxinidir}/requirements.txt
|
|
|
|
commands = alembic -c manila/db/migrations/alembic.ini revision -m ""{posargs}
|
|
|
|
|
2013-08-08 10:34:06 -04:00
|
|
|
[flake8]
|
2014-08-20 10:11:40 +02:00
|
|
|
# Following checks are ignored on purpose:
|
2020-04-01 08:38:23 +02:00
|
|
|
|
|
|
|
# Following checks should be evaluated and fixed:
|
|
|
|
# E123 closing bracket does not match indentation of opening bracket's line
|
|
|
|
# E402 module level import not at top of file
|
|
|
|
# W503 line break before binary operator
|
|
|
|
# W504 line break after binary operator
|
2020-04-01 14:36:31 +02:00
|
|
|
ignore = E123,E402,W503,W504
|
2013-08-08 10:34:06 -04:00
|
|
|
builtins = _
|
2017-07-18 18:12:37 +08:00
|
|
|
# [H106] Don't put vim configuration in source files.
|
|
|
|
# [H203] Use assertIs(Not)None to check for None.
|
|
|
|
# [H904] Use ',' instead of '%', String interpolation should be delayed to be handled by the logging code,
|
|
|
|
# rather than being done at the point of the logging call..
|
|
|
|
enable-extensions = H106,H203,H904
|
2016-05-16 20:36:48 -04:00
|
|
|
exclude = .git,.tox,.testrepository,.venv,build,cover,dist,doc,*egg,api-ref/build,*/source/conf.py
|
2014-10-16 21:36:13 +02:00
|
|
|
|
|
|
|
[hacking]
|
|
|
|
import_exceptions =
|
|
|
|
manila.i18n
|
2020-04-01 08:38:23 +02:00
|
|
|
|
|
|
|
[flake8:local-plugins]
|
|
|
|
extension =
|
|
|
|
M310 = checks:CheckLoggingFormatArgs
|
|
|
|
M313 = checks:validate_assertTrue
|
|
|
|
M323 = checks:check_explicit_underscore_import
|
|
|
|
M326 = checks:CheckForTransAdd
|
|
|
|
M333 = checks:check_oslo_namespace_imports
|
|
|
|
M336 = checks:dict_constructor_with_list_copy
|
|
|
|
M337 = checks:no_xrange
|
|
|
|
M338 = checks:no_log_warn_check
|
2020-04-16 18:08:51 -07:00
|
|
|
M339 = checks:no_third_party_mock
|
2020-04-01 08:38:23 +02:00
|
|
|
M354 = checks:check_uuid4
|
|
|
|
M359 = checks:no_translate_logs
|
2019-09-11 10:32:24 -07:00
|
|
|
paths = ./manila/tests/hacking
|
2018-03-22 15:14:44 -04:00
|
|
|
|
|
|
|
[testenv:lower-constraints]
|
|
|
|
deps =
|
|
|
|
-c{toxinidir}/lower-constraints.txt
|
|
|
|
-r{toxinidir}/test-requirements.txt
|
|
|
|
-r{toxinidir}/requirements.txt
|