This is a known bug in Sphinx's handling of C++ extensions; they can be
included into documentation unnecessarily. There is a semi-official
workaround advising you to replace these modules with Mock
objects
in your conf.py
, like this:
import sys
class Mock(object):
__all__ = []
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return Mock()
@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
else:
return Mock()
MOCK_MODULES = ['pygtk', 'gtk', 'gobject', 'argparse',
'numpy', 'numpy.random']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()