Hi all,
I’ve been working on CPython tooling and Python documentation translation and want to raise a gap I keep running into. I’d like to know whether the packaging community sees it the same way, and whether Core Metadata is the right place to address it.
The problem
Python packaging has standardised mechanisms for all of the following:
-
Implementation identity at runtime -
sys.implementation.name(PEP 421) -
Implementation-compatible wheel selection - implementation tags in wheel filenames (PEP 425)
-
Implementation-specific dependencies
implementation_nameenvironment markers (PEP 508) -
Python version constraints
Requires-Pythonin Core Metadata
What’s missing is a distribution-level Core Metadata field declaring that a package only supports certain Python implementations.
Why existing mechanisms don’t cover it
Wheel tags handle this at the artifact level pip rejects an incompatible wheel based on its filename. But an sdist has no implementation tag. When an installer falls back to an sdist, there is no standard normative metadata signal that the package is incompatible with the running implementation. The user gets a build failure or runtime error instead of a clear rejection.
Environment markers (implementation_name == "cpython" in Requires-Dist) describe when a dependency should be installed. They don’t describe whether the package itself is compatible with an implementation. These are different semantic layers.
Trove classifiers (Programming Language :: Python :: Implementation :: PyPy) are descriptive. They communicate claims but are not a normative constraint that an installer uses to reject a candidate.
Supported-Platform has existed since Core Metadata 1.1 but its semantics have never been specified. Its documented scope is OS and CPU for binary distributions - a different domain. I don’t think repurposing it is a good fit.
Proposed direction
A new optional Core Metadata field, provisionally Requires-Implementation, modelled on Requires-Python:
[project]
requires-python = ">=3.12"
requires-implementation = ["cpython", "pypy"]
Requires-Implementation: cpython
Requires-Implementation: pypy
Values correspond to sys.implementation.name (PEP 421). The set is open — no central registry needed. A missing field means no restriction; existing packages are unaffected.
Concrete examples
-
A package with CPython-internal assumptions ships only an sdist. A GraalPy user gets a confusing failure today.
Requires-Implementation: cpythonlets the installer reject the candidate before attempting a build. -
Some packages fail at the build step itself on incompatible implementations, before any wheel is produced. The incompatibility is known at the project level but there’s nowhere standard to declare it.
-
Tools comparing behaviour across implementations need machine-readable declared compatibility, not just descriptive classifiers.
Recent precedent
PEP 794 (accepted September 2025, PEP 794 – Import Name Metadata | peps.python.org ) added Import-Name and Import-Namespace to Core Metadata so project-level information can be served by an index without inspecting individual artifacts explicitly because inferring from wheel contents doesn’t work for sdists. That’s structurally close to what I’m proposing. The Simple API’s data-core-metadata means no new transport mechanism is needed.
Questions for the community
I have a direction, not a finished design. I’d specifically like feedback on:
-
Semantic layer Is Core Metadata the right place, or should this live somewhere else?
-
Value representation, Simple list of strings, or a specifier syntax? Should version-qualified constraints be in scope now or deferred?
-
Installer behaviour, MUST-reject or SHOULD-warn? Specified in Core Metadata or in installer behaviour specs?
-
Wheel interaction, what happens if a package declares
Requires-Implementation: cpythonbut publishes apy3-none-anywheel? -
Scope, should this initially be runtime-only, leaving build-environment constraints to a separate proposal?
-
Supported-Platform— Leave it alone, or use this as an opportunity to finally clarify or deprecate it?
What I’m not proposing
-
PyPI rejecting uploads based on this field
-
A closed registry of implementation names
-
Any change to wheel compatibility tags
-
Build-environment constraints
There was a short discussion in January 2024 ( Python implementation in metadata ) about implementation metadata, which concluded that classifiers are the current answer. That thread was about forcing a particular implementation in a dev environment. This is different: I’m asking whether a package can declare its own runtime compatibility as a normative constraint for installer candidate selection, especially for sdists.
Feedback very welcome, especially from pip, uv, PyPI/Warehouse, and PyPA maintainers. If the gap is real and this direction makes sense, I’ll write a formal PEP draft.