Skip to content

Commit

Permalink
Move dependency and version processing to augmentation (#143)
Browse files Browse the repository at this point in the history
In other colcon packages, the augmentation phase is responsible for
adding this information. Two reasons this is a good idea:
1. This information isn't part of a package 'identity'
2. This allows a user to specify the package type in a colcon.pkg file
   and still get the dependency information parsed correctly.
  • Loading branch information
cottsay authored Aug 30, 2023
1 parent 51bf542 commit a51925f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions colcon_ros/package_identification/ros.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def identify(self, desc): # noqa: D102
if desc.name is None:
desc.name = pkg.name

def augment_package( # noqa: D102
self, desc, *, additional_argument_names=None
):
if not desc.type.startswith('ros.'):
return

pkg, build_type = get_package_with_build_type(str(desc.path))
if not pkg:
return

desc.metadata['version'] = pkg.version

# get dependencies
Expand Down Expand Up @@ -101,6 +111,9 @@ def identify(self, desc): # noqa: D102
def augment_packages( # noqa: D102
self, descs, *, additional_argument_names=None
):
super().augment_packages(
descs, additional_argument_names=additional_argument_names)

# get all parsed ROS package manifests
global _cached_packages
pkgs = {}
Expand Down

0 comments on commit a51925f

Please sign in to comment.