Package by default: Stabilize preview feature#19197
Open
konstin wants to merge 2 commits into
Open
Conversation
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
from
April 27, 2026 20:32
7bc0276 to
373247a
Compare
konstin
force-pushed
the
konsti/package-by-default
branch
from
April 27, 2026 20:33
a3cbb2d to
8e7f3b9
Compare
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
2 times, most recently
from
April 27, 2026 20:46
d03f429 to
9206638
Compare
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
2 times, most recently
from
April 27, 2026 22:19
ebdc505 to
5fb3a93
Compare
konstin
force-pushed
the
konsti/package-by-default
branch
from
April 27, 2026 23:20
77ed055 to
e44f8c1
Compare
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
from
April 27, 2026 23:24
5fb3a93 to
4bef47b
Compare
konstin
force-pushed
the
konsti/package-by-default
branch
from
May 16, 2026 20:38
e44f8c1 to
9ee4139
Compare
konstin
force-pushed
the
konsti/package-by-default
branch
from
June 1, 2026 11:01
386eac8 to
b6c5328
Compare
konstin
force-pushed
the
konsti/package-by-default
branch
2 times, most recently
from
June 9, 2026 14:20
f7dd196 to
39c1221
Compare
konstin
added a commit
that referenced
this pull request
Jun 10, 2026
Switch the (preview) default for `uv init` to a src-package. The package by default has an entrypoint by the name of the package that can be run with `uv init foo`. There's effectively three layouts with this change: * package with entrypoint (packaged application, the default) * package without entrypoint (pure lib) * flat `main.py` application (pure app) These are selected from among the existing `--app`/`--lib` and `--package`/`--no-package` flags, as to not cause too much churn. `--build-backend` still implies `--package`, with `--app --build-backend` doesn't change. `--bare` doesn't add a build system by default. Testing is a bit awkward, cause there's now all the stable tests and a separate test for the preview behavior, while we'll have to update the stable tests upon stabilization. You can see the effect of stabilization in #19197. | kind | package | template | |-----------|----------------|----------------------------------------------------------| | (default) | (default) | entrypoint + package exposing `hello()` | | (default) | `--package` | entrypoint + package exposing `hello()` | | (default) | `--no-package` | `main.py` with `main()` | | `--app` | (default) | `main.py` with `main()` | | `--app` | `--package` | entrypoint + package exposing `hello()` | | `--app` | `--no-package` | `main.py` with `main()` | | `--lib` | (default) | package exposing `hello()` | | `--lib` | `--package` | package exposing `hello()` | | `--lib` | `--no-package` | Error: libraries are always packaged | **Navigation** There are three branches: * main <- konsti/package-by-default #17841 * konsti/package-by-default <- konsti/package-by-default-doc-changes #19026 * konsti/package-by-default <- konsti/package-by-default-stabilize #19197 **~~Open~~ Decided design questions** * Should the default layout fill out the authors table? No, the authors field isn't helpful here. * Should `--bare` also create a (by itself broken) build system by default, without setting `--package` or `--build-backend`? No, we want something that works, and not creating a build backend is very bare. It's slightly inconsistent that effectively `--bare` is no-package by default, but that's better than the alternatives and explainable as `--bare` being no-most-things.
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
2 times, most recently
from
June 10, 2026 08:38
a334f9e to
c6c098d
Compare
konstin
force-pushed
the
konsti/package-by-default-stabilize
branch
from
June 11, 2026 09:46
c6c098d to
e6abc57
Compare
konstin
marked this pull request as ready for review
June 23, 2026 11:40
Draft
konstin
added a commit
that referenced
this pull request
Jun 26, 2026
konstin
added a commit
that referenced
this pull request
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepare the changes when stabilizing package by default, as a preview how this looks after stabilization.
I've updated the snapshots of other
uv init-using test to using packaged projects (separate commit), they don't seem to be testing unpacked cases specifically and using the defaults seems the most realistic choice for them.To be merged with the next breaking release.