"Fossies" - the Fresh Open Source Software Archive

Member "nova-22.0.1/tox.ini" (19 Nov 2020, 11369 Bytes) of package /linux/misc/openstack/nova-22.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) INI source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "tox.ini": 22.0.0_vs_22.0.1.

    1 [tox]
    2 minversion = 3.1.1
    3 envlist = py38,functional,pep8
    4 # Automatic envs (pyXX) will only use the python version appropriate to that
    5 # env and ignore basepython inherited from [testenv] if we set
    6 # ignore_basepython_conflict.
    7 ignore_basepython_conflict = True
    8 
    9 [testenv]
   10 basepython = python3
   11 usedevelop = True
   12 whitelist_externals =
   13   bash
   14   find
   15   rm
   16   env
   17   make
   18 setenv =
   19   VIRTUAL_ENV={envdir}
   20   LANGUAGE=en_US
   21   LC_ALL=en_US.utf-8
   22   OS_STDOUT_CAPTURE=1
   23   OS_STDERR_CAPTURE=1
   24   OS_TEST_TIMEOUT=160
   25   PYTHONDONTWRITEBYTECODE=1
   26 # TODO(stephenfin): Remove psycopg2 when minimum constraints is bumped to 2.8
   27   PYTHONWARNINGS = ignore::UserWarning:psycopg2
   28 deps =
   29   -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
   30   -r{toxinidir}/requirements.txt
   31   -r{toxinidir}/test-requirements.txt
   32 passenv =
   33   OS_DEBUG GENERATE_HASHES
   34 # there is also secret magic in subunit-trace which lets you run in a fail only
   35 # mode. To do this define the TRACE_FAILONLY environmental variable.
   36 commands =
   37   stestr run {posargs}
   38   env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
   39   stestr slowest
   40 
   41 [testenv:mypy]
   42 description =
   43   Run type checks.
   44 envdir = {toxworkdir}/shared
   45 commands =
   46   bash tools/mypywrap.sh {posargs}
   47 
   48 [testenv:pep8]
   49 description =
   50   Run style checks.
   51 envdir = {toxworkdir}/shared
   52 commands =
   53   {[testenv:mypy]commands}
   54   bash tools/flake8wrap.sh {posargs}
   55   # Check that all JSON files don't have \r\n in line.
   56   bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
   57   # Check that all included JSON files are valid JSON
   58   bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
   59   bash tools/check-cherry-picks.sh
   60 
   61 [testenv:fast8]
   62 description =
   63   Run style checks on the changes made since HEAD~. For a full run including docs, use 'pep8'
   64 envdir = {toxworkdir}/shared
   65 commands =
   66   bash tools/flake8wrap.sh -HEAD
   67 
   68 [testenv:functional]
   69 description =
   70   Run functional tests using python3.
   71 # As nova functional tests import the PlacementFixture from the placement
   72 # repository these tests are, by default, set up to run with openstack-placement
   73 # from pypi. In the gate, Zuul will use the installed version of placement (stable
   74 # branch version on stable gate run) OR the version of placement the Depends-On in
   75 # the commit message suggests. If you want to run the tests with latest master from
   76 # the placement repo, modify the dep line to point at master, example:
   77 # deps =
   78 #   {[testenv]deps}
   79 #   git+https://opendev.org/openstack/placement#egg=openstack-placement
   80 # If you want to run the test locally with an un-merged placement change,
   81 # modify the dep line to point to your dependency or pip install placement
   82 # into the appropriate tox virtualenv.
   83 # NOTE: We express the requirement here instead of test-requirements
   84 # because we do not want placement present during unit tests.
   85 deps =
   86   {[testenv]deps}
   87   openstack-placement>=1.0.0
   88 commands =
   89 # NOTE(cdent): The group_regex describes how stestr will group tests into the
   90 # same process when running concurently. The following ensures that gabbi tests
   91 # coming from the same YAML file are all in the same process. This is important
   92 # because each YAML file represents an ordered sequence of HTTP requests. Note
   93 # that tests which do not match this regex will not be grouped in any
   94 # special way. See the following for more details.
   95 # http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
   96 # https://gabbi.readthedocs.io/en/latest/#purpose
   97   stestr --test-path=./nova/tests/functional run {posargs}
   98   stestr slowest
   99 
  100 [testenv:functional-py36]
  101 description =
  102   Run functional tests using python3.6.
  103 deps = {[testenv:functional]deps}
  104 commands =
  105   {[testenv:functional]commands}
  106 
  107 [testenv:functional-py37]
  108 description =
  109   Run functional tests using python3.7.
  110 deps = {[testenv:functional]deps}
  111 commands =
  112   {[testenv:functional]commands}
  113 
  114 [testenv:functional-py38]
  115 description =
  116   Run functional tests using python3.8.
  117 deps = {[testenv:functional]deps}
  118 commands =
  119   {[testenv:functional]commands}
  120 
  121 [testenv:api-samples]
  122 setenv =
  123   {[testenv]setenv}
  124   GENERATE_SAMPLES=True
  125   PYTHONHASHSEED=0
  126 deps = {[testenv:functional]deps}
  127 commands =
  128   stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs}
  129   stestr slowest
  130 
  131 [testenv:genconfig]
  132 envdir = {toxworkdir}/shared
  133 commands =
  134   oslo-config-generator --config-file=etc/nova/nova-config-generator.conf
  135 
  136 [testenv:genpolicy]
  137 envdir = {toxworkdir}/shared
  138 commands =
  139   oslopolicy-sample-generator --config-file=etc/nova/nova-policy-generator.conf
  140 
  141 [testenv:cover]
  142 # TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage]
  143 # section once we rely on coverage 4.3+
  144 #
  145 # https://bitbucket.org/ned/coveragepy/issues/519/
  146 envdir = {toxworkdir}/shared
  147 setenv =
  148   {[testenv]setenv}
  149   PYTHON=coverage run --source nova --parallel-mode
  150 commands =
  151   coverage erase
  152   stestr run {posargs}
  153   coverage combine
  154   coverage html -d cover
  155   coverage xml -o cover/coverage.xml
  156   coverage report
  157 
  158 [testenv:debug]
  159 envdir = {toxworkdir}/shared
  160 commands =
  161   oslo_debug_helper {posargs}
  162 
  163 [testenv:venv]
  164 deps =
  165   {[testenv]deps}
  166   -r{toxinidir}/doc/requirements.txt
  167 commands =
  168   {posargs}
  169 
  170 [testenv:docs]
  171 description =
  172   Build main documentation.
  173 # Note that we don't use {[testenv]deps} for deps here because we don't want
  174 # to install (test-)requirements.txt for docs.
  175 deps =
  176   -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/victoria}
  177   -r{toxinidir}/doc/requirements.txt
  178 commands =
  179   rm -rf doc/build/html doc/build/doctrees
  180   # Check that all JSON files don't have \r\n in line.
  181   bash -c "! find doc/ -type f -name *.json | xargs grep -U -n $'\r'"
  182   # Check that all included JSON files are valid JSON
  183   bash -c '! find doc/ -type f -name *.json | xargs -t -n1 python -m json.tool 2>&1 > /dev/null | grep -B1 -v ^python'
  184   sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
  185   # Test the redirects. This must run after the main docs build
  186   whereto doc/build/html/.htaccess doc/test/redirect-tests.txt
  187 
  188 [testenv:pdf-docs]
  189 description =
  190   Build PDF documentation.
  191 envdir = {toxworkdir}/docs
  192 deps = {[testenv:docs]deps}
  193 commands =
  194   rm -rf doc/build/pdf
  195   sphinx-build -W -b latex doc/source doc/build/pdf
  196   make -C doc/build/pdf
  197 
  198 [testenv:api-guide]
  199 description =
  200   Generate the API guide. Called from CI scripts to test and publish to docs.openstack.org.
  201 envdir = {toxworkdir}/docs
  202 deps = {[testenv:docs]deps}
  203 commands =
  204   rm -rf api-guide/build
  205   sphinx-build -W --keep-going -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
  206 
  207 [testenv:api-ref]
  208 description =
  209   Generate the API ref. Called from CI scripts to test and publish to docs.openstack.org.
  210 envdir = {toxworkdir}/docs
  211 deps = {[testenv:docs]deps}
  212 commands =
  213   rm -rf api-ref/build
  214   sphinx-build -W --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  215 
  216 [testenv:releasenotes]
  217 description =
  218   Generate release notes.
  219 envdir = {toxworkdir}/docs
  220 deps = {[testenv:docs]deps}
  221 commands =
  222   rm -rf releasenotes/build
  223   sphinx-build -W --keep-going -b html -d releasenotes/build/doctrees releasenotes/source releasenotes/build/html
  224 
  225 [testenv:all-docs]
  226 description =
  227   Build all documentation including API guides and refs.
  228 envdir = {toxworkdir}/docs
  229 deps = {[testenv:docs]deps}
  230 commands =
  231   {[testenv:docs]commands}
  232   {[testenv:api-guide]commands}
  233   {[testenv:api-ref]commands}
  234   {[testenv:releasenotes]commands}
  235 
  236 [testenv:bandit]
  237 # NOTE(browne): This is required for the integration test job of the bandit
  238 # project. Please do not remove.
  239 envdir = {toxworkdir}/shared
  240 commands = bandit -r nova -x tests -n 5 -ll
  241 
  242 [flake8]
  243 # E125 is deliberately excluded. See
  244 # https://github.com/jcrocholl/pep8/issues/126. It's just wrong.
  245 #
  246 # Most of the whitespace related rules (E12* and E131) are excluded
  247 # because while they are often useful guidelines, strict adherence to
  248 # them ends up causing some really odd code formatting and forced
  249 # extra line breaks. Updating code to enforce these will be a hard sell.
  250 #
  251 # H405 is another one that is good as a guideline, but sometimes
  252 # multiline doc strings just don't have a natural summary
  253 # line. Rejecting code for this reason is wrong.
  254 #
  255 # E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
  256 #
  257 # W504 skipped since you must choose either W503 or W504 (they conflict)
  258 #
  259 # E731 temporarily skipped because of the number of
  260 # these that have to be fixed
  261 enable-extensions = H106,H203,H904
  262 ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405,W504,E731,H238
  263 exclude =  .venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes
  264 # To get a list of functions that are more complex than 25, set max-complexity
  265 # to 25 and run 'tox -epep8'.
  266 # 39 is currently the most complex thing we have
  267 # TODO(jogo): get this number down to 25 or so
  268 max-complexity=40
  269 
  270 [hacking]
  271 import_exceptions = typing,nova.i18n
  272 
  273 [flake8:local-plugins]
  274 extension =
  275   N307 = checks:import_no_db_in_virt
  276   N309 = checks:no_db_session_in_public_api
  277   N310 = checks:use_timeutils_utcnow
  278   N311 = checks:import_no_virt_driver_import_deps
  279   N312 = checks:import_no_virt_driver_config_deps
  280   N313 = checks:capital_cfg_help
  281   N316 = checks:assert_true_instance
  282   N317 = checks:assert_equal_type
  283   N335 = checks:assert_raises_regexp
  284   N319 = checks:no_translate_logs
  285   N337 = checks:no_import_translation_in_tests
  286   N320 = checks:no_setting_conf_directly_in_tests
  287   N322 = checks:no_mutable_default_args
  288   N323 = checks:check_explicit_underscore_import
  289   N324 = checks:use_jsonutils
  290   N332 = checks:check_api_version_decorator
  291   N326 = checks:CheckForTransAdd
  292   N334 = checks:assert_true_or_false_with_in
  293   N336 = checks:dict_constructor_with_list_copy
  294   N338 = checks:assert_equal_in
  295   N339 = checks:check_http_not_implemented
  296   N340 = checks:check_greenthread_spawns
  297   N341 = checks:check_no_contextlib_nested
  298   N342 = checks:check_config_option_in_central_place
  299   N350 = checks:check_policy_registration_in_central_place
  300   N351 = checks:check_policy_enforce
  301   N343 = checks:check_doubled_words
  302   N348 = checks:no_os_popen
  303   N352 = checks:no_log_warn
  304   N349 = checks:CheckForUncalledTestClosure
  305   N353 = checks:check_context_log
  306   N355 = checks:no_assert_equal_true_false
  307   N356 = checks:no_assert_true_false_is_not
  308   N357 = checks:check_uuid4
  309   N358 = checks:return_followed_by_space
  310   N359 = checks:no_redundant_import_alias
  311   N360 = checks:yield_followed_by_space
  312   N361 = checks:assert_regexpmatches
  313   N362 = checks:privsep_imports_not_aliased
  314   N363 = checks:did_you_mean_tuple
  315   N364 = checks:nonexistent_assertion_methods_and_attributes
  316   N365 = checks:useless_assertion
  317 paths =
  318   ./nova/hacking
  319 
  320 [testenv:bindep]
  321 # Do not install any requirements. We want this to be fast and work even if
  322 # system dependencies are missing, since it's used to tell you what system
  323 # dependencies are missing! This also means that bindep must be installed
  324 # separately, outside of the requirements files, and develop mode disabled
  325 # explicitly to avoid unnecessarily installing the checked-out repo too
  326 usedevelop = False
  327 deps = bindep
  328 commands =
  329   bindep test
  330 
  331 [testenv:lower-constraints]
  332 usedevelop = False
  333 deps =
  334   -c{toxinidir}/lower-constraints.txt
  335   -r{toxinidir}/test-requirements.txt
  336   -r{toxinidir}/requirements.txt