Disable warnings as errors for sphinx

If GENERATE_TEMPEST_PLUGIN_LIST=False, the plugin-registry page is not
generated, and then sphinx fails with:

doc/source/index.rst:69:toctree contains reference to nonexisting
document u'plugin-registry'

Setting the variable to False is a legit use case, used in isolated
build environments like CBS used for RDO packages and should be
supported.

Alternatively, we could make inclusion of the page conditional to the
environment variable value, for example using 'only' directive for
sphinx and passing an appropriate 'tag' as a flag indicating the page is
generated; setup.py interface doesn't seem to provide an explicit way to
pass tags but SPHINXOPTS variable would be handy. Sadly, table of
contents can't be controlled with the directive:
https://github.com/sphinx-doc/sphinx/issues/1420

Another alternative would be to generate a stub page with no useful
info just to upease sphinx. I figured it's easier to tweak sphinx
configuration though.

The fix still leaves warnings-as-errors enabled for tox environments
with assumption that if tox is used, the build environment is not as
constrained.

Change-Id: Id174d1679c7b141b0327d8c23d6b14f7db83fae8
This commit is contained in:
Ihar Hrachyshka 2017-11-27 14:16:59 -08:00
parent c4377ef276
commit 8032b2e154
2 changed files with 3 additions and 2 deletions

View File

@ -49,7 +49,8 @@ oslo.config.opts =
[build_sphinx]
all-files = 1
warning-is-error = 1
# warning can be generated by using GENERATE_TEMPEST_PLUGIN_LIST='False'
warning-is-error = 0
build-dir = doc/build
source-dir = doc/source

View File

@ -139,7 +139,7 @@ deps =
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -b html doc/source doc/build/html
sphinx-build -W -b html doc/source doc/build/html
whitelist_externals = rm
[testenv:pep8]