Skip to content

Conversation

@henryiii
Copy link
Collaborator

@henryiii henryiii commented Oct 20, 2025

  • Still needs to verify no names match between the two lists. Maybe verify that these are valid Python identifiers (not keywords), dot separated with an optional ; private.
  • Tests
  • I'm not differentiating no entry vs. empty entry, but it looks like in the PEP that does write slightly different metadata.

(Inspired by pypa/packaging#948)

Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/feat/pep794 branch from ceed6cb to 4a57eff Compare October 23, 2025 16:23
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/feat/pep794 branch from c113f2b to aaa53aa Compare October 23, 2025 21:50
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii force-pushed the henryiii/feat/pep794 branch from 7acc8ac to 6a8898a Compare October 24, 2025 14:43
Signed-off-by: Henry Schreiner <[email protected]>
@henryiii henryiii marked this pull request as ready for review October 24, 2025 15:09
@henryiii
Copy link
Collaborator Author

I've added these two checks:

  • Verify no names gets listed twice (combining both fields)
  • Verify that 'spam.bacon.eggs' has 'spam' and 'spam.bacon' listed somewhere too. This is described in the PEP, but there's no all-caps SHOULD or similar for it.

I didn't add this one:

  • I think any package that is listed in import-names should not have any children listed. If you have a 'spam' in import-names, then you don't need to list 'spam.bacon.eggs'? Not sure on that one, haven't implemented it.

@brettcannon, thoughts, does that sound right?

@brettcannon
Copy link
Member

brettcannon commented Oct 27, 2025

  • Verify that 'spam.bacon.eggs' has 'spam' and 'spam.bacon' listed somewhere too. This is described in the PEP, but there's no all-caps SHOULD or similar for it.

That's a typo on my part; pypa/packaging.python.org#1939 .

  • I think any package that is listed in import-names should not have any children listed. If you have a 'spam' in import-names, then you don't need to list 'spam.bacon.eggs'?

That's covered by, "Projects SHOULD list all the shortest import names that are exclusively provided by the project." So if you want to be strict then your proposal makes sense it just isn't technically illegal as long as there isn't some weird namespace interleaving (e.g. a and a.b.c are in import-names but import-namespaces has a.b).

@henryiii
Copy link
Collaborator Author

henryiii commented Oct 28, 2025

I'm combining names and namespaces before doing checks, so I could add it (also in abravalheri/validate-pyproject#271), then we could always be less strict in the future if someone needs it.

Ah, no, not for this check, I see. Okay, yes, I think you could have a normal package with a namespace package inside of it. I'll leave off such a check.

@henryiii
Copy link
Collaborator Author

henryiii commented Oct 28, 2025

Okay, so I don't think the extra check is needed. I'll merge this too then if abravalheri/validate-pyproject#271 passes @abravalheri's review.

@henryiii henryiii changed the title feat: PEP 794 support feat: PEP 794 support (METADATA 2.5) Oct 28, 2025
@henryiii henryiii merged commit 495003b into main Oct 28, 2025
19 checks passed
@henryiii henryiii deleted the henryiii/feat/pep794 branch October 28, 2025 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants