colcon / colcon-ros

Extension for colcon to support ROS packages
http://colcon.readthedocs.io
Apache License 2.0
13 stars 26 forks source link

colcon dependency management does not support `<doc_depend>` #150

Open guillaumeautran opened 9 months ago

guillaumeautran commented 9 months ago

Based on the code, colcon-ros does not seem to support the type of dependencies. These dependencies behave similarly as <build_depend> but are more proper as <doc_depend> when related to doc generation. Thinks like Doxygen or Sphinx (or rosdoc2 in my case of interest).

mikepurvis commented 9 months ago

Mentioned briefly in https://github.com/colcon/colcon-ros/issues/128#issuecomment-1098518472, with the context of wanting an accurate dependency picture for the purposes of running documentation builds from colcon (also https://github.com/ros-infrastructure/rosdoc2/issues/15).

I think the easiest first pass would just be to add a stanza to this block which propagates the doc_depends from catkin_pkg into desc.dependencies['doc']:

https://github.com/colcon/colcon-ros/blob/eb0b932cf7b1f3f5a720804e67f3c1a0f8995ca8/colcon_ros/package_identification/ros.py#L86-L106

Though of course to actually do something meaningful with these, the relevant calls to PackageDescriptor.get_recursive_dependencies would need to specify the correct categories:

https://github.com/colcon/colcon-core/blob/a6aef1515b946f5af47b16d55b4f9ffaaaa27126/colcon_core/package_descriptor.py#L95-L96