In one way, I agree with this comment, but in another I’m becoming quite uncomfortable with the number of subtly different mappings that are being discussed.
PEP 566 is the current standard for mapping core metadata to JSON. The mapping rules weren’t transferred to the packaging standards documentation, but that doesn’t alter the fact that they were defined in an accepted PEP. I think we should ask the packaging and build projects why they chose not to follow PEP 566, and what it would take for them to switch to an updated standard mapping. I emphatically do not think it’s reasonable to introduce an updated mapping in PEP 819 if we can’t get existing projects to follow it. It looks like the build feature is only 2 days old, but packaging.metadata has been around for 2 years now, so there would certainly need to be some sort of transition mechanism, but we should be looking for unification here, not yet another form for people to learn.
Agreed. If JSON metadata (more accurately, I guess, structured datatypes for metadata) is to be the standard going forward, we should use the capabilities it gives us. But we need to focus on the data model rather than the representation, and recognise that we’re changing that model, not just layering parsing rules on top of the old, flat model.
Why not? How is it any harder to define core metadata in terms of strings, lists and dictionaries, with lowercase names and plurals where appropriate, plus a set of mapping rules to translate that to an email representation, than to define core metadata in a “flat” form modelled on what email format allows, with a set of mapping rules to translate to JSON and/or strings, lists and dictionaries?
Unless we use the PEP 566 rules, we’re changing the model, so let’s do it properly now, rather than creating the need for a second transition, when we’re fully using JSON metadata and tying it to a flat underlying data model no longer makes sense.
Looking at this another way, I think that if we limit the scope of PEP 819 to just the storage of metadata in JSON files, we’re pretty much compelled to use the existing standard for how to map metadata to JSON. But I’m starting to think we’d be better expanding the scope of PEP 819 to actually define the core metadata in a structured form (dictionaries, lists and strings), let the JSON format fall naturally out of how that form is serialised, and write serialisation rules for translating the new metadata format to the legacy email form. That way, when someone wants to add a new metadata item in the future, they can just use structured data naturally, get JSON serialisation for free, and it’s 100% clear that they need to define how to map the structured form to email.