uv icon indicating copy to clipboard operation
uv copied to clipboard

Add PEP 794 import name metadata support to uv build backend

Open terror opened this issue 5 months ago • 0 comments

Resolves https://github.com/astral-sh/uv/issues/16435

This first pass extends the build backend to parse, validate, and emit project.import-names / project.import-namespaces, including the new error cases and prefix checks (outlined in the PEP 794 document), and bumps metadata output to 2.5 when either field is present. It also expands the shared metadata types so we can round-trip Import-Name headers and keeps the publish path tolerant of them.

There are a few follow-up PRs to consider here, namely:

  • Threading the new fields through the resolver/database/lock layers so we can surface them in front-end commands.
  • Exposing the metadata in user-facing tooling (uv pip show, diagnostics, etc.).
  • Considering a linter or helper for computing import names automatically.

I would be willing to get these in here as well, but it may balloon the diff making it harder to review.

terror avatar Nov 05 '25 05:11 terror