Claim◆Article
uv init now defaults to a src/ shaped package
The uv init command in version 0.12.0 changes its default project layout to use a src/ directory structure instead of placing main.py in the project root. ✦ AI generated
author · Simon Willison's Weblog · 2026-07-28 · original ↗
uv init now defaults to a src/ shaped package, instead of dropping main.py in the root of the project.
Read full article ↗excerpt · fair-use quotation
- ·uv init now defaults to src/ shaped package
- ·No longer drops main.py in project root
- ·Change targets cleaner project structure
- ·Applies to default uv 0.12.0 behavior
- ·Source code lives under src/<package>/
- ·Root holds config, not runtime code
- ·Aligns with Python packaging best practices
- ·Reduces accidental import confusion
Around this claim
This moment responds to
extends → uv init 0.12.0 configures the uv_build backend for building wheels and .tar.gz distribution files when running uv buildauthor · Simon Willison's Weblogextends → uv init 0.12.0 sets up uv-init as a script alias that executes a new main() function in src/uv_init/__init__.py when run with uv run uv-initauthor · Simon Willison's Weblog