Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autodoc works locally, but does not on the ReadTheDocs

I documented some functions using autodoc. Locally it works well. When I commit to GitHub, the documentation is built on ReadTheDocs, but there are no functions that I documented with "automodule".

I added in my conf.py:

import mock

MOCK_MODULES = ['numpy', 'scipy']
for mod_name in MOCK_MODULES:
   sys.modules[mod_name] = mock.Mock() 

But it does not help.

Could this be related to the fact that I use my own C library? (I have my .c file that I compile to get .so)

like image 242
natalia Avatar asked Jul 17 '14 13:07

natalia


1 Answers

After reading you source files and the log file, I gathered two things:

  1. Why did you comment out the line sys.path.insert(os.path.abspath('../..')) in conf.py? If you read the logs, RTD can't find your modules. That line would put in the proper path.

  2. You need to put your C library as a mock module, too.

like image 67
kirbyfan64sos Avatar answered Sep 19 '22 21:09

kirbyfan64sos