Support for additional `py_binary` kwargs in `entry_point`
🚀 feature request
Relevant Rules
-
entry_point -
py_binary
Description
afaict, you cant pass kwargs - eg args, data etc into an entry_point rule, it would be handy if you could
Describe the solution you'd like
To be able to do something like
alias(
name = "my_command",
actual = entry_point(
pkg = "my.upstream.command",
script = "my.upstream.command",
data = [":some_local_data"],
args = ["$(location :some_local_data)"],
),
)
Describe alternatives you've considered
wrapping the entry_point one way or another to call it with the required data, args
one possible solution would be if you could use an entry_point alias in the srcs/main of a py_binary rule
i tried to do it but it needs a .py file, so maybe that wouldnt work with alias
i have a ~hacky workaround for this problem here https://github.com/envoyproxy/envoy/pull/19450/files#diff-41e9a812f4081144b27bc30f768b83820451109ca362e1b1ad125a04a9ffcd0bR76
https://github.com/bazelbuild/rules_python/pull/575 expands on the same pattern. I think there's value in having isolated targets but perhaps there can be an additional macro that defines a py_binary in place that allows you to add dependencies?
Or, perhaps with package_annotation (https://github.com/bazelbuild/rules_python/pull/589) a new field could be added that adds additional dependencies to the generated binary targets?
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. Collaborators can add an assignee to keep this open indefinitely. Thanks for your contributions to rules_python!
This issue was automatically closed because it went 30 days without a reply since it was labeled "Can Close?"