Skip to content

feat: implement PEP 808 — partially dynamic metadata#314

Open
henryiii wants to merge 2 commits into
abravalheri:mainfrom
henryiii:henryiii/feat/pep808-partially-dynamic
Open

feat: implement PEP 808 — partially dynamic metadata#314
henryiii wants to merge 2 commits into
abravalheri:mainfrom
henryiii:henryiii/feat/pep808-partially-dynamic

Conversation

@henryiii

Copy link
Copy Markdown
Collaborator

🤖 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.dynamic must not also be statically defined in the [project] table.

Changes

  • extra_validations.py: Added _DYNAMIC_TABLE_ARRAY_FIELDS frozenset 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). Updated validate_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.
  • Updated RedefiningStaticFieldAsDynamic error description and URL to reference PEP 808.
  • Converted the entry-points invalid example to a valid partially-dynamic example.
  • Updated the pdm/redefining-as-dynamic invalid example to use description (a string field) instead of classifiers.
  • Added invalid example for static version listed as dynamic.
  • Added valid examples for partially-dynamic dependencies and entry-points.

Assisted-by: OpenCode:glm-5

henryiii and others added 2 commits May 24, 2026 00:35
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
Comment on lines -24 to +25
_URL = (
"https://packaging.python.org/en/latest/specifications/pyproject-toml/#dynamic"
)
_URL = "https://peps.python.org/pep-0808/"

@henryiii henryiii May 25, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is technically correct short-term, but we'll be updating the spec soon, so keeping it is probably better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant