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
Structured Metadata Identity #471
base: main
Are you sure you want to change the base?
Conversation
Add `PackageMetadata.authors` and `PackageMetadata.maintainers` to the `importlib.metadata` module. These unify and provide minimal parsing for the respective core metadata fields ("Author", "Author-email"), and ("Maintainer", "Maintainer-email").
A hypothesis strategy for generating structured core metadata and equivalent unstructured text. Ensures that parsing the text using PackageMetadata results in the same structure - a roundtrip test.
* Document `PackageMetadata.authors` and `PackageMetadata.maintainers` in the usage guide. * Export `Ident` so it can be documented but also used to build custom parsing strategies.
Run the `vermin` tool to identify and fix code incompatible with Python >= 3.8.
Properties `PackageMetadata.authors` and `PackageMetadata.maintainers` are now lists with repeated elements removed, rather than sets.
I've been learning more about how metadata works, and I now have a chance to review this with a better understanding. In jaraco/jaraco.packaging#17, I learned about how the switch from These fields produce the following metadata:
And unfortunately, this patch renders that declaration as two separate individuals:
Similarly, have a look at
When I migrate these projects to pyproject.toml, they get the new format, with the name and email being stored in the |
Another issue I encountered was that my name, presumably because it contains a period, gets quoted:
Notice the excess quoting of the name. The solution here should remove those quotes as they're not part of the declared metadata. |
If we can address the above two concerns, I'd like to get this merged and available for use. |
Backport of python/cpython#108585. The first commit parameterizes the test example with
parameterized
rather thanhypothesis
, and omits the Hypothesis strategy. The second commit switches back to Hypothesis and includes the identity strategy. With this commit both PRs are equivalent.