mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 21:35:00 +00:00
Build backend: Support stubs packages (#13563)
Stubs packages are different in that their name ends with `-stubs`, their module is `<module name>-stubs` (with a dash, not the generally legal underscore) and their modules contain a `__init__.pyi` instead of an `__init__.py` (https://typing.python.org/en/latest/spec/distributing.html#stub-only-packages). We add support in the uv build backend by detecting the `-stubs` suffix. Fixes #13546 --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
c8479574f2
commit
46bc7d3477
5 changed files with 240 additions and 22 deletions
|
@ -54,6 +54,8 @@ module-name = "PIL"
|
|||
module-root = ""
|
||||
```
|
||||
|
||||
The build backend supports building stubs packages with a `-stubs` package or module name.
|
||||
|
||||
## Include and exclude configuration
|
||||
|
||||
To select which files to include in the source distribution, uv first adds the included files and
|
||||
|
|
|
@ -446,6 +446,10 @@ The name of the module directory inside `module-root`.
|
|||
|
||||
The default module name is the package name with dots and dashes replaced by underscores.
|
||||
|
||||
Package names need to be valid Python identifiers, and the directory needs to contain a
|
||||
`__init__.py`. An exception are stubs packages, whose name ends with `-stubs`, with the stem
|
||||
being the module name, and which contain a `__init__.pyi` file.
|
||||
|
||||
Note that using this option runs the risk of creating two packages with different names but
|
||||
the same module names. Installing such packages together leads to unspecified behavior,
|
||||
often with corrupted files or directory trees.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue