Skip to content

uv_build cannot find stubs-only package #13546

@jorenham

Description

@jorenham

Summary

in my pyproject.toml I have something like

[project]
name = "numpy-stubs"
# --snip--

[build-system]
requires = ["uv_build>=0.7.5,<0.8"]
build-backend = "uv_build"
# --snip--

then I run uv build, and see

Building source distribution...
Error: Missing module directory for `numpy_stubs` in `src`. Found: `numpy-stubs`, `numtype`, `_numtype`
  × Failed to build `/home/joren/Workspace/numtype`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `uv_build.build_sdist` failed (exit status: 1)
      hint: This usually indicates a problem with the package or the build environment.

I also tried

[tool.uv.build-backend]
module-name = "numpy-stubs"

but uv build then says

Building source distribution...
  × Failed to build `/home/joren/Workspace/numtype`
  ├─▶ Failed to parse: `pyproject.toml`
  ╰─▶ TOML parse error at line 7, column 15
        |
      7 | module-name = "numpy-stubs"
        |               ^^^^^^^^^^^^^
      Invalid character `-` at position 6 for identifier `numpy-stubs`, expected an underscore or an alphanumeric character

For what it's worth; here's the pyproject.toml source:
https://github.com/numpy/numtype/blob/3bbf56e28b4bfb8812529c9f1f207e8f1cb01b17/pyproject.toml

Platform

Ubuntu 22.04

Version

0.7.5

Python version

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement to existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions