Repository navigation
Conversation
lf-
added a commit
to mercury/buck2
that referenced
this pull request
Nov 24, 2026
my agent and I got really surprised by main_function not working like [project.scripts] in pyproject.toml. we assumed that the program would exit with the return code of the declared main function, however, it is instead surprisingly eaten. upstream-pr: meta#1644
Contributor
|
This pull request has been imported. If you are a Meta employee, you can view this in D134119823. (Because this pull request was imported automatically, there will not be any future comments.) |
lf-
force-pushed
the
jade/push-uqywtrkxvuuw
branch
2 times, most recently
from
November 25, 2026 18:22
46314a8 to
dfddb0c
Compare
my agent and I got really surprised by main_function not working like [project.scripts] in pyproject.toml. we assumed that the program would exit with the return code of the declared main function, however, it is instead surprisingly eaten. i usually write stuff like this (c.f. https://docs.python.org/3/library/__main__.html#idiomatic-usage), and thus i expect `main` to always return an int, which is *why* `main_function` not accepting an int is surprising to me: ``` import sys def main(): return 1 if __name__ == "__main__": sys.exit(main()) ```
lf-
force-pushed
the
jade/push-uqywtrkxvuuw
branch
from
November 26, 2026 20:32
dfddb0c to
4e82782
Compare
lf-
added a commit
to mercury/buck2
that referenced
this pull request
Nov 26, 2026
my agent and I got really surprised by main_function not working like [project.scripts] in pyproject.toml. we assumed that the program would exit with the return code of the declared main function, however, it is instead surprisingly eaten. upstream-pr: meta#1644
lf-
added a commit
to mercury/buck2
that referenced
this pull request
Nov 26, 2026
my agent and I got really surprised by main_function not working like [project.scripts] in pyproject.toml. we assumed that the program would exit with the return code of the declared main function, however, it is instead surprisingly eaten. upstream-pr: meta#1644
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
my agent and I got really surprised by main_function not working like [project.scripts] in pyproject.toml. we assumed that the program would exit with the return code of the declared main function, however, it is instead surprisingly eaten.
i usually write stuff like this (c.f. https://docs.python.org/3/library/__main__.html#idiomatic-usage), and
thus i expect
mainto always return an int, which is whymain_functionnot accepting an int is surprising to me: