-
-
Notifications
You must be signed in to change notification settings - Fork 589
feat: add shebang attribute on py_console_script_binary #2867
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
base: main
Are you sure you want to change the base?
feat: add shebang attribute on py_console_script_binary #2867
Conversation
): | ||
"""Run the generator | ||
|
||
Args: | ||
entry_points: The entry_points.txt file to be parsed. | ||
out: The output file. | ||
console_script: The console_script entry in the entry_points.txt file. | ||
console_script_guess: The string used for guessing the console_script if it is not provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm what do you mean?
This was a previously undocumented arg. I thought it seems reasonable to document it to maintain the order of arguments, and for consisency.
I don't fully understand the intention.
|
Use case: user is setting up the environment for a docker image, and needs a bash executable from the py_console_script target to run Previously, prior to Bazel mod, this was possible and simple through the use of Similar to the intention specified via PEP 441 for shebang line. |
Background
Use case: user is setting up the environment for a docker image, and needs a bash executable from the py_console_script (e.g. to run
ray
from command line without full bazel bootstrapping). User is responsible of setting up the right paths (and hermeticity concerns). There's no change in default behavior per this diff.Previously, prior to Bazel mod, this was possible and simple through the use of
rules_python_wheel_entry_points
(per here) but these are not reachable now via Bazel mod.Approach
Add a shebang attribute that allows users of the console binary to use it like a binary executable.
This is similar to the functionality that came with wheel entry points here:
rules_python/python/private/pypi/whl_library.bzl
Line 507 in 9dfa3ab
With this change, one can specify a shebang like:
TODOs: