6dfd5da306
Since we use usedevelop=True, as a result os-ken installation happens at 'develop-inst' phase and it installs requirements from requirements.txt without considering tox constraints. This can lead to issue where broken requirements are installed in docs job and as a result it will fail. In order to get constraints be considered for this case, add requirements.txt to deps for docs env. Change-Id: Id2975423df7d7c643f10f25e64d61d3680fcb38b
100 lines
3.5 KiB
INI
100 lines
3.5 KiB
INI
[tox]
|
|
minversion = 3.18.0
|
|
envlist = py3,pep8
|
|
ignore_basepython_conflict = True
|
|
|
|
[testenv]
|
|
basepython = {env:TOX_PYTHON:python3}
|
|
usedevelop = True
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
stestr run {posargs}
|
|
|
|
[testenv:pep8]
|
|
commands = flake8 {posargs}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHON=coverage run --source os_ken --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
commands = sphinx-build -W -b html doc/source doc/build/html
|
|
|
|
[testenv:pdf-docs]
|
|
envdir = {toxworkdir}/docs
|
|
deps = {[testenv:docs]deps}
|
|
allowlist_externals =
|
|
make
|
|
commands =
|
|
sphinx-build -W -b latex doc/source doc/build/pdf
|
|
make -C doc/build/pdf
|
|
|
|
[testenv:releasenotes]
|
|
deps = {[testenv:docs]deps}
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[flake8]
|
|
show-source = True
|
|
# E113: unexpected whitespace; skipped in os-ken because C-style comment blocks are used pervasively
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
# Temporarily ignoring these warnings
|
|
# W503: line break before binary operator
|
|
# E116: unexpected indentation (comment)
|
|
# E128: continuation line under-indented for visual indent
|
|
# E402: module level import not at top of file
|
|
# E501: line too long (>79 characters)
|
|
# E704: multiple statements on one line (def)
|
|
# E722: do not use bare except, specify exception instead
|
|
# E731: do not assign a lambda expression, use a def
|
|
# E741: do not use variables named 'l', 'O', or 'I'
|
|
# F401: Module imported but unused
|
|
# F403: 'from module import *' used; unable to detect undefined names
|
|
# F405: Name may be undefined, or defined from star imports: module
|
|
# F811: redefinition of unused variable
|
|
# F812: list comprehension redefines name from line
|
|
# F821: undefined name '<name>'
|
|
# F841: local variable '<variable>' is assigned to but never used
|
|
# H101: Include your name with TODOs as in ``# TODO(yourname)``
|
|
# H102: Apache 2.0 license header not found
|
|
# H104: Files with no code shouldn't contain any license header nor comments
|
|
# H105: Don't use author tags. We use version control instead.
|
|
# H201: Do not write ``except:``, use ``except Exception:`` at the very least.
|
|
# H202: assertRaises Exception too broad
|
|
# H301: Do not import more than one module per line (*)
|
|
# H306: Alphabetically order your imports by the full module path
|
|
# H401: Docstrings should not start with a space.
|
|
# H403: Multi line docstrings should end on a new line.
|
|
# H404: Multi line docstrings should start without a leading new line.
|
|
# H405: Multi line docstrings should start with a one line summary followed by an empty line.
|
|
# H501: Do not use ``locals()`` or ``self.__dict__`` for formatting strings
|
|
# W504 line break after binary operator
|
|
ignore = E113,E123,E125,W503,E116,E128,E402,E501,E704,E722,E731,E741,F401,F403,F405,F811,F812,F821,F841,H101,H102,H104,H105,H201,H202,H301,H306,H401,H403,H404,H405,H501,W504
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,os_ken/contrib
|