refactor: rework how dynamic works #157
Merged
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.
This reworks how "dynamic" works. The old way was quite broken: Because a field is project dynamic, that doesn't mean it's METADATA dynamic. And the METADATA dynamic field names are METADATA names, not project names.
This has to be split into two concepts. There's a new
metadata_dynamic
value that backends can set if they are setting dynamic metadata. If we provide a mapping, we can specify this as project field names, currently it's just METADATA field names. Will have to see which makes the most sense. This must be set by the backend if it wants to make a METADATA 2.2 dynamic field. It's not information present in the pyproject.toml. Though it is a strict subset (with appropriate name conversions).The regular "dynamic" field now is used to keep users from setting any unlisted fields after creating the class.(removed for now). A function to map names has been added.See #89. Fixes #51.