Browse Source

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
tags/3.0.1^0
Julien Danjou 2 years ago
parent
commit
c02406601a
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      pbr/builddoc.py

+ 5
- 0
pbr/builddoc.py View File

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

Loading…
Cancel
Save