-
Notifications
You must be signed in to change notification settings - Fork 137
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
Implement Metadata 2.3 #676
Conversation
Thinking about this more, I think I’m definitely over normalizing Requires-Dist if there are any markers. I’ll find some time to change it so that it only normalizes any extras. |
I've added some test cases. I believe that this is now ready for review. |
Thanks, this is looking good to me. 🙂 One minor wrinkle is that if we fall back to executing the module to get version & description, we can't actually guarantee that they won't have a different value if you build a wheel from the sdist. You could theoretically construct them so they differ based on the day of the week, or the system it's built on. But the spec also says version can't be dynamic, and hopefully no-one actually does that, so let's cross our fingers and just say it's static. I wonder if it would make sense to normalise values on the way in to |
Thanks @groodt ! |
My pleasure!
Although, I think this might have been merged prematurely. I should have
moved it to draft.
I have doubts over how I currently implemented it. See
https://discuss.python.org/t/status-or-funding-for-metadata-2-2-in-pypi/46137/36
…On Wed, 1 May 2024 at 05:12, Thomas Kluyver ***@***.***> wrote:
Thanks @groodt <https://github.com/groodt> !
—
Reply to this email directly, view it on GitHub
<#676 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACT254MJBATAJNQ7PCYK33Y77UIRAVCNFSM6AAAAABEPRUYKGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBWGY4TINBVHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ah, good point. Sorry, I didn't notice your message until now. My reading of both PEP 685 and the core metadata spec is that they only explicitly say the Looking at PEP 685, we should also make sure we throw suitable errors if invalid or clashing extras are specified. |
@takluyver Yes, I'm happy to pick it up as a follow-up. Are we sure that I'm not breaking anything with the currently merged code? I guess I'm not familiar enough with the 2 styles of extras from a library author point of view. I use extras often when I'm building apps, but not when publishing libraries as wheels. Are these both valid
Are they semantically different? |
requires requires |
Thanks @merwok That makes sense! |
I'd be surprised if things break with the current state - I'd guess pip & other package consumer tools will normalise extras in environment markers ( But to be on the safe side, I'd ideally like to normalise those as well before releasing |
PEP 643 introduces Metadata 2.2, where fields can either be static (default) or marked as dynamic.
PEP 685 introduces Metadata 2.3, that specifies how to normalize extra names.
This PR bumps the Metadata version to 2.3.
flit
has always written and published static metadata in both wheelMETADATA
and sdistPKG-INFO
and therefore this PR does not intend to add new support for recording dynamic metadata into distributions. This should not be confused with thedynamic
metadata in the pyproject.toml files, which are dynamic in flit and remain supported (PEP 621).Upgrading to the newer Core Metadata standards has advantages for the python packaging ecosystem. It makes it possible for resolvers to read metadata directly without a PEP 517 invocation, which can bring large speedups.
Towards: #675