Generating documentation using Sphinx and `sphinx.ext.autosummary` recursively for external `pybind11` module

Viewed 388

I am having issues with generating documentation using Sphinx for a python package which contains an external c++ module which uses pybind11 to generate the Python bindings.

The problem I have is that the compiled module contains several submodules, yet autosummary with the :recursive: option only appears to find the functions and classes of the highest level module. My impression is that the issue resides in that there is no explicit __init__.py file for each submodule since the bindings are all packed into one .so binary. Is there any way around this?

I am using Python 3.8 and Sphinx 3.2.1. And this is my index.rst:

.. toctree::
   :hidden:

   Home page <self>
   Examples <examples>
   API reference <_autosummary/mypackage>

And this is the api.rst:

API Reference
=============

.. autosummary::
   :toctree: _autosummary
   :template: custom-module-template.rst
   :recursive:

   mypackage
0 Answers
Related