-
-
Notifications
You must be signed in to change notification settings - Fork 167
Sphinx emits "WARNING: py:class reference target not found" with numpydoc 1.1.0 #275
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
Comments
In MNE our quick fix was to subclass dict with compatible docstrings: I think the underlying issue is actually with autodoc or something trying to Another quick fix option might be to add another autodoc processing step that converts |
Same problem for all astropy affiliated packages... Unfortunately, unlike other link matching problems, it doesn't seem to help to list either the python class or the subclass in |
I guess another option would be to allow failure on warnings on docstrings that are actually inside the code base, but non-failure on anything that comes from outside. Or inherited vs non-inherited or so. Tricky! |
This is arguably a Sphinx bug, too. This one might actually be possible to fix at the Sphinx end so it ends up in a |
@larsoner - thanks, the ignoring of the nitpicking does indeed seem a Sphinx bug. Over at astropy/astropy#10524 (comment), there was a suggestion that perhaps it has to do with the fact that the docstring in question includes a single quote. (Though, obviously, that could be a red herring.) |
For me this works fine actually:
To me it's a consistency problem that CPython and Sphinx need to decide if these are always classes, or Sphinx needs to be smarter about linking them, or we just need to live with ignoring them in projects that use Okay to close as this is a sufficient fix and should probably be fixed upstream (by autodoc or by CPython actually making these linkable)? |
I was going to close if astropy/astropy#10530 works but looks like it is closed already. Thanks for the fix, @larsoner ! |
Belated update: #275 (comment) works! Needed to do some fixing that @astrofrog pointed out but other than that, it's green again. Thanks! |
Hi, thank you for the very useful numpydoc package! The
astropy
package is a long time user ofnumpydoc
.Unfortunately, by upgrading from
numpydoc
1.0.0 to 1.1.0, we are getting many warnings that start withWARNING: py:class reference target not found...
. We also use sphinx-automodapi, where "members that a class inherits from a base class are included in the generated documentation." Hence, a class that subclasses, say,dict
, gets all the member doctrings fromdict
methods (unless overwritten).Such inheritance has never been a problem until
numpydoc
1.1.0. Can you please advise on how we can fix these warnings? Thank you!The text was updated successfully, but these errors were encountered: