Skip to content

WIP add custom shebang 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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

chrisirhc
Copy link
Contributor

@chrisirhc chrisirhc commented May 8, 2025

The shebang allows users of the console binary to use it like a binary executable.

This functionality came with wheel entry points here:

However, if one uses py_console_script_binary, they're unable to use it with a shebang.

With this change, one can specify a shebang like:

py_console_script_binary(
    name = "yamllint",
    pkg = "@pip//yamllint",
    shebang = "#!/usr/bin/env python3",
)

TODOs:

  • Update tests
  • Add test for this functionality
  • Leave default to without shebang so this is a non-breaking change

):
"""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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Unused?

Copy link
Contributor Author

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?

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.

2 participants