From e19572e2d10107ad316d81f90a4310268faac387 Mon Sep 17 00:00:00 2001 From: Timothy Chavez Date: Tue, 7 Apr 2015 12:31:55 -0500 Subject: [PATCH] Support Sphinx >=1.3 new protoype and warnings Sphinx >= 1.3 changes: - Prototypes for init_values() requires a handle to warnings.warn - New warning for setting the html_theme in conf.py to 'default': sphinx.errors.SphinxWarning: WARNING: 'default' html theme has been renamed to 'classic'. Please change your html_theme setting either to the new 'alabaster' default theme, or to 'classic' to keep using the old default. This change deals with the above sphinx updates by adding the handle to init_values() and setting pbr to _not_ fail on warnings when building the docs. Change-Id: Iba92628263e20efca84aeada0e19000f4c9b1fac --- pbr/builddoc.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pbr/builddoc.py b/pbr/builddoc.py index 3c9a9a14..a91dda92 100644 --- a/pbr/builddoc.py +++ b/pbr/builddoc.py @@ -17,7 +17,9 @@ from distutils import log import fnmatch import os +import pkg_resources import sys +import warnings try: import cStringIO @@ -130,14 +132,19 @@ class LocalBuildDoc(setup_command.BuildDoc): if self.today: confoverrides['today'] = self.today sphinx_config = config.Config(self.config_dir, 'conf.py', {}, []) - sphinx_config.init_values() + sphinx_ver = pkg_resources.get_distribution("sphinx").version + if pkg_resources.parse_version(sphinx_ver) >= \ + pkg_resources.parse_version('1.3.1'): + sphinx_config.init_values(warnings.warn) + else: + sphinx_config.init_values() if self.builder == 'man' and len(sphinx_config.man_pages) == 0: return app = application.Sphinx( self.source_dir, self.config_dir, self.builder_target_dir, self.doctree_dir, self.builder, confoverrides, status_stream, - freshenv=self.fresh_env, warningiserror=True) + freshenv=self.fresh_env, warningiserror=False) try: app.build(force_all=self.all_files)