python - How to uv init without hello.py - Stack Overflow

After using uv init in a project directory, uv creates these files:.gitREADME.mdpyproject.tomlhello

After using uv init in a project directory, uv creates these files:

.git
README.md
pyproject.toml
hello.py
.python-version
.gitignore

I don't want it to generate hello.py. I want the others, but hello.py is unusable, and I delete it every time I initialize a new environment.
I read the uv help manual and searched, but couldn't find my answer.

How can I prevent this command from generating hello.py?

After using uv init in a project directory, uv creates these files:

.git
README.md
pyproject.toml
hello.py
.python-version
.gitignore

I don't want it to generate hello.py. I want the others, but hello.py is unusable, and I delete it every time I initialize a new environment.
I read the uv help manual and searched, but couldn't find my answer.

How can I prevent this command from generating hello.py?

Share Improve this question edited Mar 30 at 23:18 Anerdw 2,1673 gold badges16 silver badges40 bronze badges asked Dec 30, 2024 at 8:24 Sadegh Pouriyan ZadehSadegh Pouriyan Zadeh 4971 gold badge4 silver badges15 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 3

There's no native support for this exact use case. v0.5.29 introduced the --bare option, which will only create pyproject.toml, but it won't work if you want to keep the other boilerplate files.

If you use Bash, you can add this alias for convenience (in pre-0.6.0 versions, replace main.py with hello.py):

alias cleanuv="uv init && rm main.py"

Then just use cleanuv instead of uv init whenever you want to start a new project.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745413280a4626628.html

相关推荐

  • python - How to uv init without hello.py - Stack Overflow

    After using uv init in a project directory, uv creates these files:.gitREADME.mdpyproject.tomlhello

    3小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信