Skip to content
Merged
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
26 changes: 24 additions & 2 deletions peps/pep-0808.rst
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ 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``'s, since this was strictly
not allowed before this PEP.

Expand All @@ -283,8 +286,27 @@ frontends may need to be updated to benefit from the partially static metadata.
Some frontends and other tooling may need updating, such as schema
validation, just like other ``pyproject.toml`` PEPs.

Using metadata from SDists or wheels is unaffected. The METADATA version does
not need to be incremented.
Static analysis tools may require updating to handle this change. Tools should
check the dynamic table first, like this:

.. code-block::

match pyproject["project"]:
# New in PEP 808
case {my.key: value, "dynamic": dyn} if my.key in dyn:
print(f"Partial {my.key}: {value}")
case {"dynamic": dyn} if my.key in dyn:
print(f"Fully dynamic {my.key}")
case {my.key: value}:
print(f"Fully static {my.key}: {value}")
case _:
print(f"No metadata for {my.key}")

Before this PEP, tools could reverse the order of the dynamic and static
blocks, assuming that an entry in the project table meant it could not be
dynamic. If they do this, they will now incorrectly assume they have all the
metadata for a field, when they in fact only have part of it.


Security Implications
=====================
Expand Down