diff options
author | Timothy Chavez <timothy.chavez@hp.com> | 2015-04-07 12:31:55 -0500 |
---|---|---|
committer | Khai Do <zaro0508@gmail.com> | 2015-08-10 12:39:39 -0700 |
commit | e19572e2d10107ad316d81f90a4310268faac387 (patch) | |
tree | 23f44ccadb2dffe2c33d673dfb5b5217064656ef | |
parent | 1e4d8836840622434230055e054666e164e10d14 (diff) | |
download | pbr-e19572e2d10107ad316d81f90a4310268faac387.tar.gz |
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
-rw-r--r-- | pbr/builddoc.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pbr/builddoc.py b/pbr/builddoc.py index 3c9a9a1..a91dda9 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) |