Skip to content

Commit eae4259

Browse files
committed
BUG: Connect to earlier event
1 parent 2400630 commit eae4259

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

numpydoc/numpydoc.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def setup(app, get_doc_object_=get_doc_object):
218218

219219
app.setup_extension('sphinx.ext.autosummary')
220220

221-
app.connect('builder-inited', update_config)
221+
app.connect('config-inited', update_config)
222222
app.connect('autodoc-process-docstring', mangle_docstrings)
223223
app.connect('autodoc-process-signature', mangle_signature)
224224
app.connect('doctree-read', relabel_references)
@@ -244,17 +244,19 @@ def setup(app, get_doc_object_=get_doc_object):
244244
return metadata
245245

246246

247-
def update_config(app):
247+
def update_config(app, config=None):
248248
"""Update the configuration with default values."""
249+
if config is None: # only really needed for testing
250+
config = app.config
249251
# Do not simply overwrite the `app.config.numpydoc_xref_aliases`
250252
# otherwise the next sphinx-build will compare the incoming values (without
251253
# our additions) to the old values (with our additions) and trigger
252254
# a full rebuild!
253-
numpydoc_xref_aliases_complete = deepcopy(app.config.numpydoc_xref_aliases)
255+
numpydoc_xref_aliases_complete = deepcopy(config.numpydoc_xref_aliases)
254256
for key, value in DEFAULT_LINKS.items():
255257
if key not in numpydoc_xref_aliases_complete:
256258
numpydoc_xref_aliases_complete[key] = value
257-
app.config.numpydoc_xref_aliases_complete = numpydoc_xref_aliases_complete
259+
config.numpydoc_xref_aliases_complete = numpydoc_xref_aliases_complete
258260

259261

260262
# ------------------------------------------------------------------------------

0 commit comments

Comments
 (0)