# uv 0.12.0 发布，uv init 命令默认采用 src 布局并配置 uv_build 后端，简化了 Python 项目初始化与构建流程

- 来源：Simon Willison
- 发布时间：2026-07-29 05:51
- AIWatch 分数：59
- AIWatch 标记：未精选
- AIWatch 链接：https://aiwatch.icu/events/evt_01kynbfrtcyzvdc6j5hjh06mnd
- 原文链接：https://simonwillison.net/2026/Jul/28/uv/#atom-everything

## 精选理由

常规快讯，保留列表

## AI 摘要

uv 0.12.0 发布，uv init 命令默认采用 src 布局并配置 uv_build 后端，简化了 Python 项目初始化与构建流程。

## 正文

uv 0.12.0

uv init is the uv shortcut for creating a new project. The previous version of uv, version 0.11.x, produced this directory when you ran uv init uv-init.

Here's what you get with uv 0.12. I have a GitHub repository that automatically snapshots the output of uv init, so you can also see the full diff:

GitHub diff view. uv-init/main.py is an old __name__=="__main__" file that has been entirely deleted. The pyproject.toml now has an authors list and a new project.scripts block defining uv-init as uv_init:main - and a new build-system block that uses uv_build as the build-backend. A new src/uv_init/__init__.py file contains a main() method with a -> None type annotation that prints Hello from uv-i

uv init now defaults to a src/ shaped package, instead of dropping main.py in the root of the project. It also configures the uv_build backend for building wheels and .tar.gz distribution files when you run uv build. Finally, it sets up uv-init as a script alias which, when run with uv run uv-init, executes a new main() function in src/uv_init/__init__.py.

I've so far avoided using src layout in my own projects just out of inertia. I think it's time I switched.

Tags: packaging, python, uv
