Closed lpsinger closed 4 years ago
Same failure in the openstack/cinder repo:
http://paste.openstack.org/show/791673/ https://opendev.org/openstack/cinder/src/branch/master/doc/source/conf.py
I think the problem is with mocked modules. At least in my case. When you mock some module and then use it like from MOCKED_MODULE_NAME as SOME_SHORT_NAME
, mocked module becomes an attribute that goes through isattributedescriptor
which calls unwrap. unwrap
inspects object looking for __wrapped__
property and the mocked module is a yes man, when asked for this property is just adds one and returns self jumping into an infinite loop.
Maybe isattributedescriptor
should check if it is a mock before calling unwrap
?
I too am experiencing this after rebuilding my virtualenv with sphinx 3.0, perhaps something helpful:
If I add a submodule to the autodoc_mock_imports like this: markdown.Markdown
no exception is thrown (but then generation is broken) same for any other submodule/module combination
Same error for me too (well, I compared 2.4.4 to 3.0.0). I also tried import pandas
instead of import pandas as pd
, but that didn't fix the problem.
conf.py
import os
import sys
sys.path.insert(0, os.path.abspath('../..'))
extensions = ['sphinx.ext.autodoc']
source_suffix = '.rst'
master_doc = 'index'
autodoc_mock_imports = ["pandas"]
example.py
import pandas
def sample_function():
print('hello world')
return
Sorry for the inconvenience. and thank you for the detailed report. I just post #7431 to fix this. Please try it if you have time.
Describe the bug The documentation set for my project fails with error messages like
ValueError: wrapper loop when unwrapping ligo.skymap.io.events
. The build worked with Sphinx 3.0.0b1, but broke with Sphinx 3.0.0. Just a guess, but I think that #7222 broke it.To Reproduce Steps to reproduce the behavior:
Expected behavior Successful build with no error messages.
Your project https://git.ligo.org/emfollow/gwcelery
Screenshots N/A
Environment info
docker run python
), but also fails on macOS and just about every platform that I have tried.