Files
cloudkitty/tox.ini
Hervé Beraud b0d5e455fc 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: I6bdfa9830a32ecf36e1931e1bb0afa366f1dfeb9
2021-01-05 14:00:00 +01:00

105 lines
2.9 KiB
INI

[tox]
minversion = 3.1.0
skipsdist = True
envlist = py36,py38,pep8
ignore_basepython_conflict = True
[testenv]
basepython = python3
whitelist_externals = rm
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
usedevelop = True
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
/usr/bin/find . -type f -name "*.py[co]" -delete
rm -f .testrepository/times.dbm
stestr run {posargs}
[testenv:debug]
commands = oslo_debug_helper {posargs}
[testenv:pep8]
commands =
flake8 {posargs} cloudkitty
doc8 {posargs}
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r cloudkitty -n5 -x cloudkitty/tests/* -ll
[testenv:cover]
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source cloudkitty --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:genconfig]
commands =
oslo-config-generator --config-file etc/oslo-config-generator/cloudkitty.conf
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/cloudkitty.conf
[testenv:docs]
deps = -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W --keep-going -b html doc/source doc/build/html
# 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
# whitelist_externals =
# make
# commands =
# sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
# make -C doc/build/pdf
[testenv:venv]
commands = {posargs}
[flake8]
filename = *.py,app.wsgi
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
[doc8]
ignore-path = .venv,.git,.tox,.tmp,*cloudkitty/locale*,*lib/python*,cloudkitty.egg*,doc/build,releasenotes/*
[hacking]
import_exceptions = cloudkitty.i18n
[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
paths = ./cloudkitty/hacking
[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:lower-constraints]
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt