Skip to content

Fix generated script when entry point func name is used by the script template #240

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

Closed
wants to merge 1 commit into from

Conversation

hukkin
Copy link

@hukkin hukkin commented Jan 14, 2025

A fix for the issue identified at the end of this message: #239 (comment)

@pfmoore
Copy link
Member

pfmoore commented Jan 14, 2025

As noted in #239, I don’t think this is a sufficiently important issue in practice to warrant the extra complexity.

@hukkin
Copy link
Author

hukkin commented Jan 14, 2025

Fair enough, then this can be closed.

I personally wouldn't make any bets, though, that no one ever has, or ever will, try to use re, sys or __name__ as an entry point function's name.

The first two are only 2 and 3 letters, and could well have meanings (as words, abbreviations or acronyms) that totally make sense as an entry point function. Languages other than English exist too.

The way these error when used is really bad IMO. No error when building a package. No error when installing a package. A cryptic exception, pointing to a line of code not in the wrapped tool's codebase, is only raised when a user eventually tries to run the installed code. If a user wanted to file an issue, they probably would have a hard time figuring out where to.

__name__ is very unlikely to be used as an entry point name, but if it is, the result is even worse. The script can be run, but it is a no-op that exits successfully with exit code 0.

@vsajip vsajip closed this Jan 14, 2025
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.

3 participants