You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manual checks revealed this was related to the Napolean extension. (Commenting out napoleon from conf.py prevents the error message, but this is not a helpful solution.)
By adding a line print(obj) to the function _process_docstring in the file sphinx/ext/napoleon/__init__.py, the Cython extension appears to be the cause. The error message with the extra print lines then becomes:
Extension error:
Handler <function _process_docstring at 0x7f1a9f310cb0> for event 'autodoc-process-docstring' threw an exception (exception: module, class, method, function, traceback, frame, or code object was expected, got builtin_function_or_method)
<module 'iodata.overlap_accel' from '/home/toon/univ/code/iodata/iodata/overlap_accel.cpython-37m-x86_64-linux-gnu.so'>
<built-in function add_overlap>
<built-in function fac2>
make: *** [Makefile:21: html] Error 2
To Reproduce
Steps to reproduce the behavior:
git clone [email protected]:theochem/iodata.git
cd iodata
./setup.py build_ext -i
cd doc
make html
Expected behavior
A more understandable error message would be helpful. Ideally, Napoleon should just process docstrings of "builtin" functions. These are not necessarily built-in to Python. They can be functions from any extension module.
I think this is a duplicate of #8074 and fixed in #8077. The reason is that inspect.getfile, which is used to provide a location for a warning, raises a TypeError for docstrings defined in C extensions (which I completely missed when writing #7690). The fix will be included in 3.2.1
Describe the bug
Our CI crashed with a rather cryptic error message when building the documentation, see https://travis-ci.com/github/theochem/iodata/jobs/370345521#L1842
Manual checks revealed this was related to the Napolean extension. (Commenting out napoleon from
conf.py
prevents the error message, but this is not a helpful solution.)By adding a line
print(obj)
to the function_process_docstring
in the filesphinx/ext/napoleon/__init__.py
, the Cython extension appears to be the cause. The error message with the extra print lines then becomes:To Reproduce
Steps to reproduce the behavior:
Expected behavior
A more understandable error message would be helpful. Ideally, Napoleon should just process docstrings of "builtin" functions. These are not necessarily built-in to Python. They can be functions from any extension module.
Your project
https://github.com/theochem/iodata/
Screenshots
not applicable
Environment info
sphinx.ext.napoleon
Additional context
not applicable
The text was updated successfully, but these errors were encountered: