sphinxext: Add 'merge_domaindata'

This is necessary to enable parallel builds. As noted in the Sphinx docs
[1], this method has the following function:

  Merge in data regarding docnames from a different domaindata inventory
  (coming from a subprocess in parallel builds).

Given how simple the datatypes we're storing are, this is pretty easy to
implement.

[1] https://www.sphinx-doc.org/en/master/extdev/domainapi.html#sphinx.domains.Domain.merge_domaindata

Change-Id: I46c7903b159f99c68896a4c3c4d20daef848f9c2
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1895162
This commit is contained in:
Stephen Finucane 2020-09-10 15:58:12 +01:00
parent fcb88941e3
commit 01f63b875e

View File

@ -495,6 +495,15 @@ class ConfigDomain(Domain):
)
return None
def merge_domaindata(self, docnames, otherdata):
for target, docname in otherdata['options'].items():
if docname in docnames:
self.data['options'][target] = docname
for target, docname in otherdata['groups'].items():
if docname in docnames:
self.data['groups'][target] = docname
def setup(app):
# NOTE(dhellmann): Try to turn off lazy translation from oslo_i18n