uv 0.12.0
https://github.com/astral-sh/uv/releases/tag/0.12.0">uv 0.12.0
Some interesting breaking changes in this release of
uv, in particular to the default project produced by the uv init command.https://docs.astral.sh/uv/concepts/projects/init/">uv init is the uv shortcut for creating a new project.
The previous version of uv, version 0.11.x, produced https://github.com/simonw/uv-init-demos/tree/29656a55ec733a632005abfd7b89dea5c04fa10b/uv-init">this directory when you ran uv init uv-init.
Here's https://github.com/simonw/uv-init-demos/tree/9111a2bb85741f034eee2fd63efe13ef98b37a14/uv-init">what you get with uv 0.12.
I have a GitHub repository that https://simonwillison.net/2025/Dec/24/uv-init-demos/">automatically snapshots the output of uv init, so you can also https://github.com/simonw/uv-init-demos/commit/9111a2bb85741f034eee2fd63efe13ef98b37a14#diff-e036881d034aedd813010ffa96464995ae5b0339213d6f4ab492f97442c5bdd4">see the full diff:
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-init." src="https://static.simonwillison.net/static/2026/uv-diff.webp" />
uv init now defaults to a src/ shaped package, instead of dropping main.py in the root of the project.
It also configures the https://docs.astral.sh/uv/concepts/build-backend/">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 https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/">src layout in my own projects just out of inertia.
I think it's time I switched.
Tags: https://simonwillison.net/tags/packaging">packaging, https://simonwillison.net/tags/python">python, https://simonwillison.net/tags/uv">uv