Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: rework how dynamic works #157

Merged
merged 4 commits into from
Sep 18, 2024

Conversation

henryiii
Copy link
Collaborator

@henryiii henryiii commented Sep 14, 2024

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.

@henryiii henryiii changed the title refacotor: rework how dynamic works refactor: rework how dynamic works Sep 14, 2024
@henryiii
Copy link
Collaborator Author

For simplicity, I'm going to wait to add the "setting" protection till a later PR, just in case it's not a good idea. I'll stick to the minimum here.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii marked this pull request as ready for review September 17, 2024 05:27
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii henryiii merged commit 182eee5 into pypa:main Sep 18, 2024
24 checks passed
@henryiii henryiii deleted the hernyiii/refactor/dynamic branch September 18, 2024 18:52
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.

Allow specifying dynamic fields after initial load
1 participant