Skip to content

dependency on sphinx.ext.autosummary #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anntzer opened this issue Nov 8, 2017 · 6 comments
Closed

dependency on sphinx.ext.autosummary #141

anntzer opened this issue Nov 8, 2017 · 6 comments

Comments

@anntzer
Copy link
Contributor

anntzer commented Nov 8, 2017

It appears that numpydoc has a hard dependency on sphinx.ext.autosummary being active (it inserts some .. autosummary:: directives). This is fine, but perhaps numpydoc.setup should just call sphinx.ext.autosummary.setup in that case? (in the sense that I don't see much of a point in erroring out instead, which is the current behavior if sphinx.ext.autosummary is not listed in conf.py)

@jnothman
Copy link
Member

jnothman commented Nov 8, 2017

Strictly this is only true if numpydoc_show_class_members is true (which it is by default) add numpydoc processes class docstrings, or if the class docstrings explicitly list methods.

But assuming there is minimal risk in automatically installing autosummary, I am +1 for this.

@anntzer
Copy link
Contributor Author

anntzer commented Nov 8, 2017

I guess you can even delay loading sphinx.ext.autosummary until the point where you actually know you'll need it, but that seems a bit overengineering it.

@pv
Copy link
Member

pv commented Nov 8, 2017 via email

@anntzer
Copy link
Contributor Author

anntzer commented Nov 8, 2017

Actually the correct way seems to be to call app.setup_extension, which is documented at http://www.sphinx-doc.org/en/stable/extdev/appapi.html?highlight=setup_extension and used e.g. by autosummary to load autodoc (https://github.com/sphinx-doc/sphinx/blob/master/sphinx/ext/autosummary/__init__.py#L623).

@jnothman
Copy link
Member

Would you like to submit a PR? Thanks

@anntzer
Copy link
Contributor Author

anntzer commented Nov 13, 2017

Nah, you get to do it :-) (no hurry)

jnothman added a commit to jnothman/numpydoc that referenced this issue Nov 13, 2017
jnothman added a commit that referenced this issue Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants