11PEP: 808
2- Title: Including static values in dynamic project metadata
2+ Title: Including static values in dynamic metadata
33Author: Henry Schreiner <henryschreineriii@gmail.com>,
44 Cristian Le <python@lecris.dev>
55Sponsor: Filipe Laíns <lains@python.org>
@@ -19,7 +19,8 @@ Abstract
1919This PEP relaxes the constraint on dynamic metadata listed in the ``[project] ``
2020section in ``pyproject.toml ``. It is now permitted to define a static portion
2121of a dynamic metadata field in the ``[project] `` table as long as the field is
22- a table or array.
22+ a table or array. Likewise, METADATA 2.6 allows mixed static and dynamic
23+ metadata to be specified in source distribution metadata.
2324
2425This allows users to opt into allowing a backend to extend metadata while still
2526keeping the static portions of the metadata defined in the standard location in
@@ -254,6 +255,29 @@ and backends can continue to fill it as they choose. However, a backend MUST
254255ensure that both the SDist and the wheel metadata include the static metadata
255256portion of the project table.
256257
258+ In METADATA 2.2 to 2.5, there are no constraints on entries listed as
259+ ``Dynamic `` (which means a wheel can have different metadata than the SDist for
260+ that field. Now, metadata fields specified in the SDist are guaranteed to also
261+ be in the wheel, even if Dynamic is present. The METADATA version will be
262+ incremented to 2.6. Given this example::
263+
264+ Dynamic: Requires-Dist
265+ Requires-Dist: packaging
266+
267+ Before METADATA 2.6, there are no constraints on a field if it appeared in
268+ ``Dynamic ``, so the wheel could contain anything; now in 2.6, any values here
269+ are guaranteed to be also present in wheels, so the wheel will contain
270+ ``Requires-Dist: packaging ``; it may contain more ``Requires-Dist ``, but it
271+ will contain at least that one.
272+
273+ This new point will be added to the guidelines:
274+
275+ * If a multiple use field is present in a source distribution and also marked
276+ ``Dynamic ``, a wheel can add values, but it must include the one(s) present
277+ in the SDist. ``Keywords ``, ``Author-Email ``, and ``Maintainer-Email `` are
278+ comma-separated lists, and can likewise be extended if present.
279+
280+
257281Reference Implementation
258282========================
259283
@@ -273,9 +297,6 @@ metadata.
273297Backwards Compatibility
274298=======================
275299
276- Using metadata from SDists or wheels is unaffected. The METADATA version does
277- not need to be incremented.
278-
279300This does not affect any existing ``pyproject.toml `` files, since this was
280301strictly not allowed before this PEP.
281302
0 commit comments