I'm trying to generate Sphinx documentation for a Python project and host the documentation using Read The Docs. The project code is here. When I run make clean && make html
to generate documentation locally the documentation generates and has all four of my Python modules:
Local Docs
I have Read The Docs connected to Github to generate documentation on a new commit and it successfully generates documentation for 2/4 of my Python modules but two of them don't appear. The Read The Docs build seems to run with no errors: Read The Docs
My local build has some warnings but they don't seem to be related to the documentation not appearing:
$ make clean && make html
Removing everything under '_build'...
Running Sphinx v3.2.1
making output directory... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 3 source files that are out of date
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] source/modules
/<home>/argos-translate/argostranslate/package.py:docstring of argostranslate.package.Package:24: WARNING: Unexpected indentation.
/<home>/argos-translate/argostranslate/package.py:docstring of argostranslate.package.Package:30: WARNING: Block quote ends without a blank line; unexpected unindent.
/<home>/argos-translate/argostranslate/translate.py:docstring of argostranslate.translate.Language:7: WARNING: Unexpected indentation.
/<home>/argos-translate/argostranslate/translate.py:docstring of argostranslate.translate.Language:8: WARNING: Block quote ends without a blank line; unexpected unindent.
looking for now-outdated files... none found
pickling environment... done
checking consistency... /<home>/argos-translate/docs/source/modules.rst: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] source/modules
generating indices... genindex py-modindexdone
writing additional pages... searchdone
copying static files... ... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded, 5 warnings.
The HTML pages are in _build/html.
Always check the RTD build log for "warning" or "error".
In your case, the latest build log has the following relevant warnings for the two modules that were not documented on RTD:
WARNING: autodoc: failed to import module 'gui' from module 'argostranslate'; the following exception was raised:
No module named 'ctranslate2'
...
WARNING: autodoc: failed to import module 'translate' from module 'argostranslate'; the following exception was raised:
No module named 'ctranslate2'
This implies a required dependency has not been specified to be installed on RTD. Make sure you specify ctranslate2
as a requirement in your project such that RTD can install it. See Specifying Dependencies for complete details.