Skip to content

Commit 929f7ab

Browse files
committed
Move setup of autosummary earlier in setup().
`setup()` calls `app.setup_extension('sphinx.ext.autosummary')` so that end users who add numpydoc to their extension list don't need to declare a dependency on autosummary, but we may just as well move the call to setup_extension even earlier, which also removes the need to declare a dependency on autodoc (as autosummary will initialize it). Otherwise, users need to be careful to have autodoc *before* numpydoc in their extension list; without that they get an "Unknown event name: autodoc-process-docstring" error.
1 parent 659e43f commit 929f7ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

numpydoc/numpydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ def setup(app, get_doc_object_=get_doc_object):
176176
global get_doc_object
177177
get_doc_object = get_doc_object_
178178

179+
app.setup_extension('sphinx.ext.autosummary')
180+
179181
app.connect('autodoc-process-docstring', mangle_docstrings)
180182
app.connect('autodoc-process-signature', mangle_signature)
181183
app.connect('doctree-read', relabel_references)
@@ -191,8 +193,6 @@ def setup(app, get_doc_object_=get_doc_object):
191193
app.add_domain(NumpyPythonDomain)
192194
app.add_domain(NumpyCDomain)
193195

194-
app.setup_extension('sphinx.ext.autosummary')
195-
196196
metadata = {'version': __version__,
197197
'parallel_read_safe': True}
198198
return metadata

0 commit comments

Comments
 (0)