Skip to content

WIP: Support Metadata 2.5 (PEP 794)#2179

Draft
edgarrmondragon wants to merge 1 commit intopypa:masterfrom
edgarrmondragon:pep794
Draft

WIP: Support Metadata 2.5 (PEP 794)#2179
edgarrmondragon wants to merge 1 commit intopypa:masterfrom
edgarrmondragon:pep794

Conversation

@edgarrmondragon
Copy link
Contributor

@edgarrmondragon edgarrmondragon commented Feb 17, 2026

Description

Adds support for PEP 794, which bumps core metadata to version 2.5 and introduces fields Import-Name and Import-Namespaces.

  • Names are validated with str.isidentifier(), after splitting each name into its submodules, if any
  • Import names starting with _ are marked as private with the ; private modifier

TODOs

Empty Import-Name

Projects MAY set import-names an empty array and not set import-namespaces at all in a pyproject.toml file (e.g. import-names = []). To match this, projects MAY have an empty Import-Name field in their metadata. This represents a project with NO import names, public or private (i.e. there are no Python modules of any kind in the distribution file).

Handle ambiguity

If a project lists the same name in both Import-Name and Import-Namespace, then tools MUST raise an error due to ambiguity; this also applies to import-names and import-namespaces, respectively.

Add a default Import-Name

in practice the majority of projects have their project name match what their import name would be. As such, it is a reasonable assumption to make that a project name that is normalized in some way to an import name (e.g. packaging.utils.canonicalize_name(name, validate=True).replace("-", "_")) can be used if some answer is needed.

Links

@edgarrmondragon edgarrmondragon changed the title Support Metadata 2.5 (PEP 794) WIP: Support Metadata 2.5 (PEP 794) Feb 17, 2026
@edgarrmondragon edgarrmondragon force-pushed the pep794 branch 2 times, most recently from 48aa0e8 to da775dd Compare February 17, 2026 18:48
Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
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.

1 participant

Comments