-
-
Notifications
You must be signed in to change notification settings - Fork 586
Support python -m
invocation style
#2539
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
Comments
A note for a possible cleanup - the py_console_script_binary could diructly leverage this feature. It could be also harvested for the initial implementation to support this. |
github-merge-queue bot
pushed a commit
that referenced
this issue
Mar 19, 2025
…m) (#2671) This implements the ability to run a module name instead of a file path, aka `python -m` style of invocation. This allows a binary/test to specify what the main module is without having to have a direct dependency on the entry point file. As a side effect, the `srcs` attribute is no longer required. Fixes #2539
This has made it possible to integrate
Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Python supports two ways to start programs: by file, or by module name.
Today, only file is supported. This is a FR for
-m
to also be supported. There's two main use cases for this style:Some example use cases:
This should be fairly easy to implement using bootstrap script. It just requires passing the name of the main module to the stage2 bootstrap instead of the path to the main module.
Docs for
-m
: https://docs.python.org/3.10/using/cmdline.html#cmdoption-mSee also: runpy.run_module: https://docs.python.org/3.10/library/runpy.html#runpy.run_module
The text was updated successfully, but these errors were encountered: