Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions peps/pep-0808.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PEP: 808
Title: Including static values in dynamic project metadata
Title: Including static values in dynamic metadata
Author: Henry Schreiner <henryschreineriii@gmail.com>,
Cristian Le <python@lecris.dev>
Sponsor: Filipe Laíns <lains@python.org>
Expand All @@ -19,7 +19,8 @@ Abstract
This PEP relaxes the constraint on dynamic metadata listed in the ``[project]``
section in ``pyproject.toml``. It is now permitted to define a static portion
of a dynamic metadata field in the ``[project]`` table as long as the field is
a table or array.
a table or array. Likewise, METADATA 2.6 allows mixed static and dynamic
metadata to be specified in source distribution metadata.

This allows users to opt into allowing a backend to extend metadata while still
keeping the static portions of the metadata defined in the standard location in
Expand Down Expand Up @@ -254,6 +255,29 @@ and backends can continue to fill it as they choose. However, a backend MUST
ensure that both the SDist and the wheel metadata include the static metadata
portion of the project table.

In METADATA 2.2 to 2.5, there are no constraints on entries listed as
``Dynamic`` (which means a wheel can have different metadata than the SDist for
that field. Now, metadata fields specified in the SDist are guaranteed to also
be in the wheel, even if Dynamic is present. The METADATA version will be
incremented to 2.6. Given this example::

Dynamic: Requires-Dist
Requires-Dist: packaging

Before METADATA 2.6, there are no constraints on a field if it appeared in
``Dynamic``, so the wheel could contain anything; now in 2.6, any values here
are guaranteed to be also present in wheels, so the wheel will contain
``Requires-Dist: packaging``; it may contain more ``Requires-Dist``, but it
will contain at least that one.

This new point will be added to the guidelines:

* If a multiple use field is present in a source distribution and also marked
``Dynamic``, a wheel can add values, but it must include the one(s) present
in the SDist. ``Keywords``, ``Author-Email``, and ``Maintainer-Email`` are
comma-separated lists, and can likewise be extended if present.


Reference Implementation
========================

Expand All @@ -273,9 +297,6 @@ metadata.
Backwards Compatibility
=======================

Using metadata from SDists or wheels is unaffected. The METADATA version does
not need to be incremented.

This does not affect any existing ``pyproject.toml`` files, since this was
strictly not allowed before this PEP.

Expand Down
Loading