Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable document generation using rosdoc2 for ament_python pkgs #587

Merged
merged 7 commits into from
Mar 14, 2023

Conversation

Yadunund
Copy link
Member

Fix missing exec_depends in package.xmls and docstrings to generate documentation without any warnings using autodoc

Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
<exec_depend>launch_ros</exec_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>tf2_ros</exec_depend>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, this one shouldn't be necessary; this is strictly a python package, so the tf2_ros_py dependency should be enough. The same goes for a few places below.

Signed-off-by: Yadunund <yadunund@openrobotics.org>
@Yadunund
Copy link
Member Author

Thanks for the review! I've moved tf2_ros to <doc_depend>. I understand now that the tf2_ros_py module is imported as tf2_ros for backwards compatibility.

The sphinx_builder.py script also needs this patch Yadunund/rosdoc2@226f905 to include <doc_depends> into the autodoc_mock_imports list. I've updated the Checklist in rosdoc2 to ensure we land this patch.

@Yadunund Yadunund changed the title Enable document generation using rosdoc2 Enable document generation using rosdoc2 for ament_python pkgs Mar 13, 2023
@clalancette
Copy link
Contributor

I've moved tf2_ros to <doc_depend>

Out of curiousity, why did you choose this route rather than a custom conf.py? I'm fine with either solution, but I do think we should expand the comment a bit to explain that modules import tf2_ros while the package is named tf2_ros_py.

Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
@Yadunund
Copy link
Member Author

To my knowledge even with a custom conf.py file, autodoc will complain that it cannot import tf2_ros when documenting such modules.

In my latest commit, I added custom rosdoc2.yaml + sphinx source files to tf2_ros_py. We now have documentaion for python tf2_ros module 🎉

Screenshot from 2023-03-14 13-50-27

@clalancette
Copy link
Contributor

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@clalancette clalancette merged commit 8920381 into rolling Mar 14, 2023
@clalancette clalancette deleted the yadu/rosdoc2_deps branch March 14, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants