Add PEP 794 import name metadata support to uv build backend#16598
Add PEP 794 import name metadata support to uv build backend#16598terror wants to merge 7 commits into
Conversation
| let uses_pep794 = import_names_provided || import_namespaces_provided; | ||
| let metadata_version = if uses_pep794 { | ||
| debug!("Found import name metadata declarations, using METADATA 2.5"); | ||
| "2.5" |
There was a problem hiding this comment.
Note that shipping this is blocked on adding support in warehouse (pypi/warehouse#19083)
|
PyPI and packaging now both support PEP 794, so I think this PR can be revisited – thanks! Twine also has an open PR, which is being worked on: pypa/twine#1315. |
|
I think that twine PR would be superseded by pypa/twine#1317. We're only waiting for a release now. |
|
This is a tad old so I'm reviewing it as well 😅 |
|
I've rebased and added some fixes and rewrites in #19380 |
Ah, okay. I'll close this one out! |
|
Sorry for the bad timing, I saw this earlier today and created a new branch (to avoid messing with the history here), not realizing that you were also reviving this at the same time. |
Resolves #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-tripImport-Nameheaders and keeps the publish path tolerant of them.There are a few follow-up PRs to consider here, namely:
I would be willing to get these in here as well, but it may balloon the diff making it harder to review.