rules_ros2 icon indicating copy to clipboard operation
rules_ros2 copied to clipboard

Allow customization of Python rules

Open ahans opened this issue 9 months ago • 3 comments

I have a use case where I'd like to use the py_binary from rules_py as the backend of ros2_py_binary instead of the default one from rules_python. My current solution is a local patch. Would there be any issues with allowing customization from the user? We could probably simply expose the target parameter and default it to None. If it's set, we'll use it. Otherwise, we use the variant from rules_python just like today. What do you think? Am I missing anything? If not, I would put up a PR with this change.

ahans avatar Mar 20 '25 21:03 ahans

Fine by me, please create a PR.

mvukov avatar Mar 23 '25 18:03 mvukov

Just curious, why do you patch this repo at the moment? You could juse pass target argument to https://github.com/mvukov/rules_ros2/blob/main/ros2/py_defs.bzl#L8.

mvukov avatar Mar 23 '25 20:03 mvukov

Just curious, why do you patch this repo at the moment? You could juse pass target argument to https://github.com/mvukov/rules_ros2/blob/main/ros2/py_defs.bzl#L8.

I actually tried that, but Bazel told me I was not allowed to use that macro. Looks like macros with leading underscore are automatically made private.

ahans avatar Mar 24 '25 19:03 ahans