Skip to content

Conversation

@henryiii
Copy link
Contributor

@henryiii henryiii commented Oct 23, 2024

Working toward #647. Starting by making it possible to go from Metadata back to RFC822.

@brettcannon
Copy link
Member

I don't know if I'm comfortable with the JSON support. I actually almost had it in the first version of the module, but decided against it until we had a standard around it.

@henryiii
Copy link
Contributor Author

Well, it is in PEP 566, so that's why I added it to pyproject-metadata. Though there's no use for it yet, so I can easily drop it.

I'll probably make a PR building on this PR for the next step.

This is starting as a fairly direct copy of pyproject-metadata, adapted for packaging's existing features and with the non-backward compatible changes listed in pypa/pyproject-metadata#140. I've got permission from the original copyright holders in pypa/pyproject-metadata#103 to contribute to packaging under the packaging license.

This PR also has the following changes vs. the original:

  • All metadata keys are lower case, instead of title case. Headers in messages are not case sensitive.
  • The ordering of the keys is based on the ordering in the Metadata class, which is slightly different compared to pyproject-metadata.

@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch 3 times, most recently from 1774407 to ebfed9f Compare October 24, 2024 03:57
@henryiii henryiii mentioned this pull request Oct 24, 2024
6 tasks
@henryiii
Copy link
Contributor Author

FYI, on the flaking pypy-3.8 (and 3.9, possibly?) test, PyPy doesn't support pypy-3.8 or pypy-3.9 anymore. Only pypy-3.10 is actively supported.

@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch 3 times, most recently from 68ff492 to bc2ab34 Compare October 25, 2024 02:48
@henryiii henryiii marked this pull request as ready for review October 25, 2024 03:09
@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch 2 times, most recently from 6ff8657 to 31d400a Compare May 23, 2025 04:30
@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch from 31d400a to 09758bc Compare July 26, 2025 05:13
@henryiii
Copy link
Contributor Author

henryiii commented Sep 8, 2025

Okay, I've compared this to the current implementation in pyproject-metadata. The one fix I've added there is a patch to support form feeds in Python <3.12.4. It's a bit finicky, though, as it only supports form feeds followed by a space (unlike 3.12.4+, which doesn't require that), and since this is a new feature, I think it's fine without the patch unless it turns out to be needed?

@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch from 25241d6 to ba659fd Compare September 8, 2025 19:49
@henryiii henryiii force-pushed the henryiii/feat/metadatawrite branch from ba659fd to d7d3687 Compare September 13, 2025 00:24
@henryiii henryiii merged commit 3b20e0f into pypa:main Sep 13, 2025
39 checks passed
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.

2 participants