Skip to content

Add ros2 pkg depends verb - #1268

Open
Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:add-pkg-depends
Open

Add ros2 pkg depends verb#1268
Miko997 wants to merge 1 commit into
ros2:rollingfrom
Miko997:add-pkg-depends

Conversation

@Miko997

@Miko997 Miko997 commented Aug 13, 2026

Copy link
Copy Markdown

Description

Add ros2 pkg depends <package_name> to print the package's direct declared dependencies.

The verb reads the installed package.xml, evaluates dependency conditions against the current environment, and prints unique dependency names in sorted order. Recursive lookup and dependency-type filters are outside this PR.

Addresses #44

Is this user-facing behavior change?

Yes. ros2 pkg now provides a depends verb for installed packages.

Additional Information

Validation:

  • focused unit and CLI tests: 2 passed
  • ros2pkg tests excluding unavailable xmllint: 6 passed, 1 deselected
  • copyright, flake8, and pep257: 3 passed
  • git diff --check

xmllint was not available in the test environment. This PR does not change XML files.

Signed-off-by: Miko Parkkinen <141511110+Miko997@users.noreply.github.com>
@mergify

mergify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@fujitatomoya fujitatomoya left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what is the difference between this and ros2 pkg xml | grep? for maintainability, we do not want to maintain the overlapped features for sure.

besides, #44 is originally created almost 10 years ago. i am not sure if there are any requests from community... at least, it's been 10 years...

@Timple

Timple commented Aug 15, 2026

Copy link
Copy Markdown

Would the outcome be different than

colcon list --names-only --packages-up-to <package_name>

?

@fujitatomoya

Copy link
Copy Markdown
Collaborator

@Miko997 a couple of questions here before starting review, please have them checked out.

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.

3 participants