Files
blazar/tox.ini
Hervé Beraud 963097ee7f Add doc/requirements
We need to specify doc requirements in doc/requirements.txt
to avoid problems with the pip resolver [1] for the release team [2][3].
Removed specific doc requirements from test-requirements.txt.

The problem here is that this repos haven't doc/requirements.txt file
and by default in this case zuul will use the test-requirements.txt file
to pull requirements [4].

This requirements file contains extra requirements like flake8 that
collided with those allowed in our job environment and so the new pip
resolver fails to install these requirements and the job exits in error.

This project meet the conditions leading to the bug.

[1] http://lists.openstack.org/pipermail/release-job-failures/2021-January/001500.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019611.html
[3] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019612.html
[4] https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/ensure-sphinx/tasks/main.yaml#L36

Change-Id: I0c39bb5581c120190a764b25890ba868180a59fe
2021-01-05 16:20:37 +01:00

116 lines
3.5 KiB
INI

[tox]
envlist = py36,py38,pep8
minversion = 3.1.1
skipsdist = True
ignore_basepython_conflict = True
[testenv]
basepython = python3
usedevelop = True
whitelist_externals = rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
setenv = VIRTUAL_ENV={envdir}
DISCOVER_DIRECTORY=blazar/tests
PYTHONHASHSEED=0
commands =
lockutils-wrapper python setup.py testr --slowest --testr-args="{posargs}"
sitepackages = False
[testenv:cover]
setenv =
{[testenv]setenv}
PYTHON=coverage run --source blazar --parallel-mode
commands =
coverage erase
lockutils-wrapper python setup.py testr --testr-args="{posargs}"
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:pep8]
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[testenv:docs]
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/html doc/build
rm -rf doc/source/apidoc doc/source/api
sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
whitelist_externals = make
commands =
sphinx-build --keep-going -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:genconfig]
commands = oslo-config-generator --config-file=etc/blazar/blazar-config-generator.conf
[flake8]
show-source = true
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,api-ref
# NOTE(tonyb): Ignore a few errors/warnings that are now "on by default".
# W503 line break before binary operator
# W504 line break after binary operator
# E402 module level import not at top of file
ignore=H105,H238,E123,E402,W503,W504
# [H904] Delay string interpolations at logging calls.
enable-extensions=H904
# To get a list of functions that have a complexity of 17 or more, set
# max-complexity to 17 and run 'tox -epep8'.
# 23 is currently the most complex thing we have:
# 'ManagerService.update_lease' - blazar/manager/service.py
max-complexity=23
[flake8:local-plugins]
extension =
C312 = checks:no_translate_logs
paths = ./blazar/hacking
[testenv:pylint]
deps = -r{toxinidir}/requirements.txt
pylint==1.9.1
commands = pylint blazar
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
# This environment is called from CI scripts to test and publish
# the API Ref to docs.openstack.org.
deps = {[testenv:docs]deps}
commands =
rm -rf api-ref/build
sphinx-build -WE --keep-going -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:genpolicy]
commands =
oslopolicy-sample-generator --config-file etc/blazar/blazar-policy-generator.conf
[testenv:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
# This environment can be used to quickly validate that all needed system
# packages required to successfully execute test targets are installed
[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.
deps = bindep
commands = bindep test