-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Autodoc failing to import *some* modules, only on RTD #8622
Comments
Hi @anicusan , I suspect the problem might be that autosummary produces misleading warnings: sphinx-doc/sphinx#7989 Therefore, I suspect that there is some missing dependency or error that arises on import, even if |
It may be worth checking that |
Hi @astrojuanlu and @humitos , a million thanks, I found the issue - stupidly forgetting to add If you found this issue via Google: you might have a dependency missing deep inside the module imports (if you have e.g. multiple .py files or submodules) and the library may end up in a partially initialised state before the import error happened. In such cases, the library might look like it installed successfully, but autosummary errors only on the parent modules of the script where the missing library import failed. Rather confusing indeed, but installing only the packages listed in "requirements.txt" - and nothing else, and no |
Details
Hello, I have a rather odd situation where essentially the same Sphinx conf / code I used for another Python library (pept) works perfectly, but for Coexist produces warnings only on readthedocs.
My
.readthedocs.yml
file is quite vanilla:Expected Result
Creating the docs locally works perfectly, with no warnings produced. I tested on new, empty environments with Python 3.7 and 3.9; the library is written in pure Python, no C extensions or deeply-nested module hierarchies. I expected correct autosummaries on RTD too.
Actual Result
Looking at the build logs, the library installation went fine; there are no import errors:
Successfully installed coexist-0.1.0
. However, when generating the docstrings with autosummary & numpydoc, I get multiple warnings only on RTD, e.g.WARNING: autosummary: failed to import coexist.plots.access
; however, other objects at the same nesting level are found, e.g.writing output... [ 44%] manual/generated/coexist.schedulers.Scheduler
.In summary:
autosummary: failed to import
, even at the same nesting level.No amount of fiddling, Googling and reading documentation seemed to solve this.
Any help would be greatly appreciated.
Best wishes,
Leonard
The text was updated successfully, but these errors were encountered: