ros2 / ros2cli

ROS 2 command line interface tools
Apache License 2.0
172 stars 161 forks source link

Subdirectories not installed with ros2pkg's ament_python template #790

Closed ijnek closed 1 year ago

ijnek commented 1 year ago

Currently, the ament_python template has packages=[package_name], as seen below:

https://github.com/ros2/ros2cli/blob/cf020c0f0f90ded9aca6ebac806c78a387347a25/ros2pkg/ros2pkg/resource/ament_python/setup.py.em#L8

However, with this configuration, it seems that subdirectories are not installed when running colcon build.

Perhaps it is better to have in the template:

from setuptools import find_packages  # at top of setup.py.em

packages=find_packages(exclude=['test']),

like many ros2 python packages do, including most packages in ros2cli do. Happy to raise a PR if others agree with this change.

Related issue: https://github.com/ros-sports/soccer_ipm/pull/7

clalancette commented 1 year ago

After discussing this, it seems that using find_packages is more standard, so we'd be happy to review a PR that changes this. Note that if we make this change, we'll also have to update the tutorials at https://github.com/ros2/ros2_documentation .

ijnek commented 1 year ago

Thanks for having a discussion about this, I've gone ahead and created a PR in #801 and in https://github.com/ros2/ros2_documentation/pull/3302 to update the docs.