-
-
Notifications
You must be signed in to change notification settings - Fork 167
'autosummary: failed to import' when using numpydoc instead of sphinx.ext.napoleon #426
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
There's a lot here so it's difficult to say anything concrete. Given the build warnings you've posted at the top and the fact that your problem is platform specific, my best guess is that there is some sort of environment management/install problem. The warnings make it look like the stimuli package isn't fully installed, at least not correctly, in the environment where you got the warnings. This of course doesn't explain why there's a difference between using napoleon/numpydoc, but perhaps you installed them in different envs? Or ran/re-ran the set of commands with one installed and not the other? In other words if I were trying to debug this I'd start by ensuring that the environment/package installation is 100% correct and behaving exactly the way I expect. The test procedure outlined at the end of your post looks fine to me... at least there's nothing that jumps out to me as potentially problematic, so I really don't know 🤷 Sorry this isn't that helpful "/ - there's only so much one can do when the failing example is so non-specific & doesn't reproduce on all platforms. |
Hello @rossbar! Thank you for looking into it. I've played with it more after the initial post, and I figured out a couple of additional points.
I've written those bullet points from memory, from the experimentations I did a couple of months ago on this sandbox repository. So maybe some version changes in |
Is there any link to #204 ? |
I found the configuration which makes the bug appear or disappear. Consider the following directory structure.
This is the content of the next archive file : The help page for A is OK: But the help page for B is wrong. We can see that the "methods" summary is empty: The files _A.py and B.py have the same content. The only difference is that the class A is located in the file "_A.py" (this is OK) while the class B is in the file "B.py" (this fails). In summary, the bug is that the "Methods" section is not correctly produced by Sphinx in some cases. I hope that this may help to find the bug. |
@jschueller: From what I can see in the file _AxialStressedBeamReliability.py, you also found this bug, isn'it? |
yes, the error message is a bit different though:
|
maybe numpydoc is confused when the package/class/method have the same name ? |
That does ring the bell, I think the class should not have the name of the module in which it is defined. |
But there is no reason to require such a constraint, is it? |
I've been playing with doc build for a while now, using this sandbox repository with a simple project and code-base. I am running into an issue a bit similar to #80, I'm at a complete loss and I only managed to narrow it down to 'bad things happen when I used numpydoc on macOS and on Windows'.
When building the documentation on my Linux PC, or on the GitHub CI with this workflow, the build works without any issue. Here is the current version deployed.
When building the documentation locally on my Windows or macOS PC, I'm greeted with 52 similar warnings. You can find 2 of them below:
And obviously, the documentation is a bit broken. Based on the pasted warnings, take the
Noise
class defined innoise.py
: Left -> local (windows). Right -> CI (ubuntu). Both build on the same commit,Why is
numpydoc
involved?It turns out that if I remove
numpydoc
from the extensions and loadsphinx.ext.napoleon
instead, the doc builds without warnings (except the missingx-ref
since they are not defined anymore). However, the render is missing the summary tables, so at least it makes sense that warnings about those tables are missing:And the attributes and method tables that are failing are a feature of
numpydoc
, right?In both cases, the generated
.rst
is the same:I tried with different templates, and with the default templates, but nothing changed.
I'm at a complete loss as to why the doc build is failing on macOS or Windows, and not on Linux, I'm not even sure it's a bug, or an issue with my configuration. Here is a couple of lines to set-up the project if you want to give it a try:
The text was updated successfully, but these errors were encountered: