builddoc: uses the new Sphinx 1.6 code for multiple builder

As noted by stephenfin, Sphinx 1.6 provides its own code to build doc with
multiple builders. The one provided by pbr so far for Sphinx < 1.6 is not even
compatible with 1.6. This patch fixes that by running the native Sphinx code
for Sphinx > 1.6 and falling back to the old code for older Sphinx versions.

Closes-Bug: #1691129
Change-Id: I5224235b1056a248b246c54e2d99eea94d53c4eb
This commit is contained in:
Julien Danjou 2017-05-17 12:05:59 +02:00
parent 12a1c1dc3c
commit c02406601a
1 changed files with 5 additions and 0 deletions

View File

@ -186,6 +186,11 @@ class LocalBuildDoc(setup_command.BuildDoc):
# TODO(stephenfin): Deprecate this functionality once we depend on
# Sphinx 1.6, which includes a similar feature, in g-r
# https://github.com/sphinx-doc/sphinx/pull/3476
self.finalize_options()
if hasattr(self, "builder_target_dirs"):
# Sphinx >= 1.6.1
return setup_command.BuildDoc.run(self)
# Sphinx < 1.6
for builder in self.builders:
self.builder = builder
self.finalize_options()