Create main.py instead of hello.py in uv init (#10369)

Initially it seemed like `app.py` might be slightly more desirable but
people seem to overwhelmingly favour `main.py` as a good "generic" name.

Fixes #7782
This commit is contained in:
Aria Desires 2025-02-13 16:58:02 -05:00 committed by Zanie Blue
parent 61fcdfb2e4
commit 9138b35c66
4 changed files with 32 additions and 31 deletions

View file

@ -22,7 +22,7 @@ Applications are the default target for `uv init`, but can also be specified wit
$ uv init example-app
```
The project includes a `pyproject.toml`, a sample file (`hello.py`), a readme, and a Python version
The project includes a `pyproject.toml`, a sample file (`main.py`), a readme, and a Python version
pin file (`.python-version`).
```console
@ -30,7 +30,7 @@ $ tree example-app
example-app
├── .python-version
├── README.md
├── hello.py
├── main.py
└── pyproject.toml
```
@ -49,7 +49,7 @@ dependencies = []
The sample file defines a `main` function with some standard boilerplate:
```python title="hello.py"
```python title="main.py"
def main():
print("Hello from example-app!")
@ -61,7 +61,7 @@ if __name__ == "__main__":
Python files can be executed with `uv run`:
```console
$ uv run hello.py
$ uv run main.py
Hello from example-project!
```