`uv init --package` generates an invalid layout for `-stubs` packages
bug
### Summary
`uv init --package` generates a regular package layout for distribution names ending in `-stubs`, but `uv_build` interprets those names as stub-only packages.
For example:
```console
$ uv init --package foo-stubs
$ cd foo-stubs
$ uv build
Building source distribution (uv build backend)...
× Failed to build `/private/var/folders/7s/tk9b38l11172qj8b4r1f17r80000gn/T/tmp.fsPhXVeHko/foo-stubs`
╰─▶ Expected a Python module at: src/foo-stubs/__init__.pyi
```
This is because initialization generates:
```text
src/foo_stubs/__init__.py
```
However, `uv_build` recognizes the `-stubs` suffix and expects:
```text
src/foo-stubs/__init__.pyi
```
`uv init` should either reject `-stubs` names for templates that generate regular runtime packages, or generate a compliant stub-only package layout while preserving the literal `-stubs` suffix.
Found while reviewing #17841.
### Platform
all
### Version
0.11.18
### Python version
_No response_
3 条评论