feat: implement PEP 808 — partially dynamic metadata#314
Open
henryiii wants to merge 2 commits into
Open
Conversation
Allow array and table fields (dependencies, classifiers, entry-points, scripts, gui-scripts, keywords, license-files, optional-dependencies, urls, authors, maintainers, import-names, import-namespaces) to be both statically defined in [project] and listed in project.dynamic. String fields (version, description, requires-python, readme, license) remain prohibited from being both static and dynamic. - Add _DYNAMIC_TABLE_ARRAY_FIELDS frozenset to extra_validations.py - Update validate_project_dynamic() to skip check for list/table fields - Update RedefiningStaticFieldAsDynamic description and URL for PEP 808 - Convert entry-points invalid example to valid partially-dynamic example - Update pdm/redefining-as-dynamic to test description (string field) - Add invalid example for static version listed as dynamic - Add valid examples for partially-dynamic dependencies and entry-points Assisted-by: OpenCode:glm-5
henryiii
commented
May 25, 2026
Comment on lines
-24
to
+25
| _URL = ( | ||
| "https://packaging.python.org/en/latest/specifications/pyproject-toml/#dynamic" | ||
| ) | ||
| _URL = "https://peps.python.org/pep-0808/" |
Collaborator
Author
There was a problem hiding this comment.
This is technically correct short-term, but we'll be updating the spec soon, so keeping it is probably better.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Human guided, AI assisted PR (using this skill). AI text below. 🤖
Summary
Implements PEP 808 — partially dynamic metadata, which relaxes the constraint that fields listed in
project.dynamicmust not also be statically defined in the[project]table.Changes
extra_validations.py: Added_DYNAMIC_TABLE_ARRAY_FIELDSfrozenset listing the 13 fields PEP 808 allows to be partially dynamic (authors,maintainers,classifiers,dependencies,entry-points,scripts,gui-scripts,keywords,license-files,optional-dependencies,urls,import-names,import-namespaces). Updatedvalidate_project_dynamic()to skip the static+dynamic check for these fields. String fields (version,description,requires-python,readme,license) remain prohibited from being both static and dynamic.RedefiningStaticFieldAsDynamicerror description and URL to reference PEP 808.description(a string field) instead ofclassifiers.versionlisted as dynamic.dependenciesandentry-points.Assisted-by: OpenCode:glm-5