Skip to content

Allow customization of underlying rule in ros2_py_{binary,test} #460

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahans
Copy link
Contributor

@ahans ahans commented Mar 24, 2025

This is what I had in mind. I can add an example where we use rules_py, but wasn't sure whether pulling in rules_py just for this is justified.

Fixes #458

@@ -46,19 +45,23 @@ def _ros2_py_exec(target, name, srcs, main, set_up_ament, **kwargs):
**launcher_target_kwargs
)

def ros2_py_binary(name, srcs, main, set_up_ament = False, **kwargs):
def ros2_py_binary(name, srcs, main, set_up_ament = False, target_rule = None, **kwargs):
Copy link
Collaborator

Choose a reason for hiding this comment

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

TBH, I wouldn't change ros2_py_binary & ros2_py_test. I'd introduce ros2_py_exec where target_rule and is_test are exposed. That one would internally call _ros2_py_exec.

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.

Allow customization of Python rules
2 participants