-
Notifications
You must be signed in to change notification settings - Fork 18
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 PEP 639: support for Metadata-Version: 2.4
; Part I
#24
Implement PEP 639: support for Metadata-Version: 2.4
; Part I
#24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
f'{dist_info}/METADATA': make_message([ | ||
('Metadata-Version', '2.4'), | ||
('Name', name), | ||
('Version', version), | ||
*metadata, | ||
], description), | ||
f'{dist_info}/WHEEL': make_message([ | ||
('Wheel-Version', '1.0'), | ||
('Generator', 'ziglang make_wheels.py'), | ||
('Root-Is-Purelib', 'false'), | ||
('Tag', tag), | ||
]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metadata version bump is backwards compatible. Please see https://peps.python.org/pep-0639/#backwards-compatibility for more. I tested recent versions of pip
and uv
, and they installed a wheel I generated for my M-series device without hiccups. I'll need to see if compliance with PyPI uploads is working, though, that's more important to figure out.
('Project-URL', 'Homepage, https://ziglang.org'), | ||
('Project-URL', 'Source Code, https://github.com/ziglang/zig-pypi'), | ||
('Project-URL', 'Bug Tracker, https://github.com/ziglang/zig-pypi/issues'), | ||
('Requires-Python', '~=3.5'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://endoflife.date/python states that security releases for Python 3.7 have ended. Now that 3.13 is just around the corner, maybe we should update to a minimum of 3.8 (either here or as a separate PR). Please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm aware of the EOL status of Python 3.5 (it was EOL when I wrote this package). I decided that this requirement should be bumped only if the package isn't installable/usable, since there isn't really a cost to keeping it low, and it could help someone using old Python versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, makes sense!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we do change the launcher in such a way it stops working on earlier Python versions, we should support the last non-EOL version, of course.
Lines 122 to 127 in f1cd7a9
import os, sys | |
argv = [os.path.join(os.path.dirname(__file__), "{entry_name}"), *sys.argv[1:]] | |
if os.name == 'posix': | |
os.execv(argv[0], argv) | |
else: | |
import subprocess; sys.exit(subprocess.call(argv)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't access a Python version that old unless I use actions/setup-python
in a CI setup – and I remember that your previous mention in our earlier conversations of one to not become a maintenance burden. So we could leave it until someone asks; I doubt anyone will, though, since those Pythons are really old 😄
Thanks! |
Running ❯ uvx twine check dist/ziglang-0.13.0-py3-none-macosx_12_0_arm64.whl --strict
I guess this might be because |
Oops, you merged too quickly, maybe! :D I'll open a new PR to fix any changes, though I would request not to upload any missing wheels with this. |
Upstream issue: pypa/twine#1146 |
A fix should get merged soon: pypa/twine#1123 |
Noted. |
pypi/warehouse#16949 has just been merged, and I've noticed a few issues with my implementation – I intend to fix them before uploading wheels can be ready. In particular, I see:
This is easy to fix, of course.
This is something I didn't implement at the time; looks like other backends are doing so in parts, too: pypa/setuptools#4728. What I don't understand about this is that the Zig source in the wheels should remain unchanged, so I'm supposed to move but copy the relevant license files that I added in this PR. But isn't that just going to create duplicate files? I feel that's a limitation of the PEP, because it doesn't cover this case (where multiple licenses are going to be present across subfolders). The other option is to just copy the MIT (Expat) license file for this project (which would be the more usual approach) and add a note about the licensing for the bundled Zig source in the README. Do you have any thoughts? I'll validate the changes with updated versions of |
That's fine. The archive isn't winning any size competition anyway, and text compresses well. |
Metadata-Version: 2.4
Metadata-Version: 2.4
; Part I
Description
This PR implements PEP 0639 for
make_wheels.py
, which bumps the core metadata version from 2.1 to 2.4.Here's a short summary of the changes that have been added:
'License': 'MIT'
(now deprecated) field has been changed to the favoured'License-Expression': 'MIT'
field, i.e., the SPDX identifier for the MIT License;'License-File':
. The multiple uses of this field include all of the licensing-related files I could find in theRECORD
file that gets generated and re-checked manually in the source. There is a chance I might have missed a few, so, if you find any, please let me know!I'll add additional information and context in a self-review below where I feel more context is needed, please let me know if I should add a few in-line comments in the code, too, for future references. Thank you!