From 8032b2e154066494600e2a73b26ec15036a2f242 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Mon, 27 Nov 2017 14:16:59 -0800 Subject: [PATCH] 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 --- setup.cfg | 3 ++- tox.ini | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 04bb29f759..c9813700d1 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 diff --git a/tox.ini b/tox.ini index c0df8a6308..ca20d177df 100644 --- a/tox.ini +++ b/tox.ini @@ -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]