Automatic document generation for python (ament_python) packages in the ROS ecosystem has been a long pending ask and the purpose of this ticket is to serve as a checklist of PRs/patches to land to deliver this functionality.
PRs/Code to merge into this repo in specific order:
[ ] Bonus: Update sphix_builder.py to not always overwrite any user specific autodoc_mock_imports with exec_depend modules.
I've incorporated all these changes into temporary branch for my testing and I'm pleased to share that document generation has gone well for most of the ament_python packages in the ros2 org. Along the way I've had to make some changes some packages to successfully generate documentation. Most of the changes are related to populating the package.xml with missing exec_depends. Without this, autodoc will try to import these dependency modules when importing the module to be documented. The downside of this is that cross-reference across pkgs is not yet supported but I'll discuss this and other todo's for the future later below. Other changes include fixes to docstrings to comply with sphinx/autodoc spec.
PRs to merge to generate documentation without any warnings
Automatic document generation for python (
ament_python
) packages in the ROS ecosystem has been a long pending ask and the purpose of this ticket is to serve as a checklist of PRs/patches to land to deliver this functionality.PRs/Code to merge into this repo in specific order:
sphinx_builder.py
to append pkg source directory to system path when using autogeneratedconf.py
.package_src_directory
made available from https://github.com/rkent/rosdoc2/commit/3fb714120e594e80f58d8fe45658f369368fd13d intodocs_build
such that the python interpreter can access pakg modules when running the user writtenconf.py
fileautodoc_mock_imports
with python modules that are listed as system packages inpackage.xml
(eg.python3-babeltrace
).<doc_depend>
dependencies in list of modules to include inautodoc_mock_imports
autodoc_mock_imports
withexec_depend
modules.I've incorporated all these changes into temporary branch for my testing and I'm pleased to share that document generation has gone well for most of the
ament_python
packages in theros2
org. Along the way I've had to make some changes some packages to successfully generate documentation. Most of the changes are related to populating thepackage.xml
with missingexec_depends
. Without this,autodoc
will try to import these dependency modules when importing the module to be documented. The downside of this is that cross-reference across pkgs is not yet supported but I'll discuss this and other todo's for the future later below. Other changes include fixes to docstrings to comply with sphinx/autodoc spec.PRs to merge to generate documentation without any warnings
Document generation results using combined changes