summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Larson <larson.eric.d@gmail.com>2020-06-25 15:09:29 -0400
committerEric Larson <larson.eric.d@gmail.com>2020-06-25 15:09:29 -0400
commiteae4259f535c229f140b1536a36cf4b401e16277 (patch)
treef04453daf3ee0bf5c75bb26cf747d66d06c9b674
parent24006306e1e7dd120bf4ff2a43bb3f4853fdddd3 (diff)
downloadnumpydoc-eae4259f535c229f140b1536a36cf4b401e16277.tar.gz
BUG: Connect to earlier event
-rw-r--r--numpydoc/numpydoc.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/numpydoc/numpydoc.py b/numpydoc/numpydoc.py
index 652eedc..5914b26 100644
--- a/numpydoc/numpydoc.py
+++ b/numpydoc/numpydoc.py
@@ -218,7 +218,7 @@ def setup(app, get_doc_object_=get_doc_object):
app.setup_extension('sphinx.ext.autosummary')
- app.connect('builder-inited', update_config)
+ app.connect('config-inited', update_config)
app.connect('autodoc-process-docstring', mangle_docstrings)
app.connect('autodoc-process-signature', mangle_signature)
app.connect('doctree-read', relabel_references)
@@ -244,17 +244,19 @@ def setup(app, get_doc_object_=get_doc_object):
return metadata
-def update_config(app):
+def update_config(app, config=None):
"""Update the configuration with default values."""
+ if config is None: # only really needed for testing
+ config = app.config
# Do not simply overwrite the `app.config.numpydoc_xref_aliases`
# otherwise the next sphinx-build will compare the incoming values (without
# our additions) to the old values (with our additions) and trigger
# a full rebuild!
- numpydoc_xref_aliases_complete = deepcopy(app.config.numpydoc_xref_aliases)
+ numpydoc_xref_aliases_complete = deepcopy(config.numpydoc_xref_aliases)
for key, value in DEFAULT_LINKS.items():
if key not in numpydoc_xref_aliases_complete:
numpydoc_xref_aliases_complete[key] = value
- app.config.numpydoc_xref_aliases_complete = numpydoc_xref_aliases_complete
+ config.numpydoc_xref_aliases_complete = numpydoc_xref_aliases_complete
# ------------------------------------------------------------------------------