Skip to content
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

FR: uv init option to specify alternative filename to hello.py #7782

Open
nbbaier opened this issue Sep 29, 2024 · 4 comments
Open

FR: uv init option to specify alternative filename to hello.py #7782

nbbaier opened this issue Sep 29, 2024 · 4 comments
Labels
cli Related to the command line interface projects Related to project management capabilities

Comments

@nbbaier
Copy link

nbbaier commented Sep 29, 2024

When using uv init (or uv init --app), I find it kind of strange that entrypoint file generated is named hello.py and not main.py. Right, as far as I can tell, now the only solution is to manually change the filename.

It would be great to have an option to specify the entrypoint's filename, something like uv init --entrypoint main.py, or change the default to main.py instead of hello.py

@charliermarsh
Copy link
Member

My initial reaction is that adding an argument for this feels unnecessary. It’s almost as much work to provide the argument as it is to rename the file. I’m gonna defer to @zanieb on this one though.

@nbbaier
Copy link
Author

nbbaier commented Sep 29, 2024

Fair point. I think my preference here would actually be making uv init generate main.py over hello.py. Should have made that my request! For now, I've implemented this manually in my .zshrc with:

uvi() {
    uv init "$@"
    mv hello.py main.py
}

@bluss
Copy link
Contributor

bluss commented Sep 29, 2024

#7670 is similar but not the same, about picking more commonly preferred defaults

@zanieb
Copy link
Member

zanieb commented Sep 29, 2024

I think we could call it main.py instead — though having a function main in a file main and also having a __main__ file in some cases could be confusing. I'm not attached to the default name of hello.py though. It was mostly intended to be an example file that matched the other init kinds which have a hello command and function.

@zanieb zanieb added projects Related to project management capabilities cli Related to the command line interface labels Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface projects Related to project management capabilities
Projects
None yet
Development

No branches or pull requests

4 participants