-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
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. |
@orbisvicis Do you have plans to address the aforementioned issues? |
In the jaraco.packaging.metadata module, I've implemented a quick and dirty routine to extract authors and emails from metadata, and that's what I've been using in my projects. I'd rather prefer we have something robust and tested in importlib metadata itself, but the current approach isn't acceptable. I'm going to close this for now, but I welcome a revival of the effort in the future. Just say the word and we can re-open this pull request, or feel free to file a new one, addressing the aforementioned concerns. |
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.