-
Notifications
You must be signed in to change notification settings - Fork 624
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
packaged app: use executable named for the project and main function #7670
base: main
Are you sure you want to change the base?
Conversation
@@ -1423,7 +1423,7 @@ fn init_virtual_project() -> Result<()> { | |||
dependencies = [] | |||
|
|||
[project.scripts] | |||
hello = "foo:hello" | |||
foo = "foo:main" |
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.
Maybe I'm mistaken here, but I think this test shows that uv init --virtual
is already creating something with a build system and executable, this is fishy.
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.
Yeah this is fishy — --virtual
is legacy now but shouldn't be doing this. Let's tackle it separately though.
docs/concepts/projects.md
Outdated
@@ -247,7 +247,7 @@ requires-python = ">=3.11" | |||
dependencies = [] | |||
|
|||
[project.scripts] | |||
hello = "example_packaged_app:hello" | |||
example-packaged-app = "example_packaged_app:hello" |
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.
This should be :main
right?
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.
oops, fixed.
Also I'm very used to force pushing but shouldn't do that since you squash merge here anyway. I just haven't learned the lesson yet..
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.
Oh we force push all the time, don't worry about that.
Create a function main as the default for a packaged app. Configure the default executable as: example-packaged-app = "example_packaged_app:main" Which is often what you want - the executable has the same name as the app.
I'm off today but I'll try to get this in early next week. |
Summary
Create a function main as the default for a packaged app. Configure the default executable as:
example-packaged-app = "example_packaged_app:main"
Which is often what you want - the executable has the same name as the app.
The purpose is to more often hit what the user wants, so they don't have
to even rename the command to start developing.
Test Plan