-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -48,7 +48,7 @@ def writestr(self, zinfo_or_arcname, data, *args, **kwargs): | |||||||||||||
|
||||||||||||||
def make_message(headers, payload=None): | ||||||||||||||
msg = EmailMessage() | ||||||||||||||
for name, value in headers.items(): | ||||||||||||||
for name, value in headers: | ||||||||||||||
if isinstance(value, list): | ||||||||||||||
for value_part in value: | ||||||||||||||
msg[name] = value_part | ||||||||||||||
|
@@ -71,18 +71,18 @@ def write_wheel(out_dir, *, name, version, tag, metadata, description, contents) | |||||||||||||
dist_info = f'{name}-{version}.dist-info' | ||||||||||||||
return write_wheel_file(os.path.join(out_dir, wheel_name), { | ||||||||||||||
**contents, | ||||||||||||||
f'{dist_info}/METADATA': make_message({ | ||||||||||||||
'Metadata-Version': '2.1', | ||||||||||||||
'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, | ||||||||||||||
}), | ||||||||||||||
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), | ||||||||||||||
]), | ||||||||||||||
}) | ||||||||||||||
|
||||||||||||||
|
||||||||||||||
|
@@ -134,20 +134,33 @@ def write_ziglang_wheel(out_dir, *, version, platform, archive): | |||||||||||||
name='ziglang', | ||||||||||||||
version=version, | ||||||||||||||
tag=f'py3-none-{platform}', | ||||||||||||||
metadata={ | ||||||||||||||
'Summary': 'Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.', | ||||||||||||||
'Description-Content-Type': 'text/markdown', | ||||||||||||||
'License': 'MIT', | ||||||||||||||
'Classifier': [ | ||||||||||||||
'License :: OSI Approved :: MIT License', | ||||||||||||||
], | ||||||||||||||
'Project-URL': [ | ||||||||||||||
'Homepage, https://ziglang.org', | ||||||||||||||
'Source Code, https://github.com/ziglang/zig-pypi', | ||||||||||||||
'Bug Tracker, https://github.com/ziglang/zig-pypi/issues', | ||||||||||||||
], | ||||||||||||||
'Requires-Python': '~=3.5', | ||||||||||||||
}, | ||||||||||||||
metadata=[ | ||||||||||||||
('Summary', 'Zig is a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.'), | ||||||||||||||
('Description-Content-Type', "'text/markdown'; charset=UTF-8; variant=GFM"), | ||||||||||||||
agriyakhetarpal marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
('License-Expression', 'MIT'), | ||||||||||||||
('License-File', 'LICENSE'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/glibc/LICENSES'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/mingw/COPYING'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/musl/COPYRIGHT'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/wasi/LICENSE'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/wasi/LICENSE-APACHE'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/wasi/LICENSE-APACHE-LLVM'), | ||||||||||||||
('License-File', 'ziglang/lib/libc/wasi/LICENSE-MIT'), | ||||||||||||||
('License-File', 'ziglang/lib/libcxx/LICENSE.TXT'), | ||||||||||||||
('License-File', 'ziglang/lib/libcxxabi/LICENSE.TXT'), | ||||||||||||||
('License-File', 'ziglang/lib/libunwind/LICENSE.TXT'), | ||||||||||||||
('Classifier', 'Development Status :: 4 - Beta'), | ||||||||||||||
('Classifier', 'Intended Audience :: Developers'), | ||||||||||||||
('Classifier', 'Topic :: Software Development :: Compilers'), | ||||||||||||||
('Classifier', 'Topic :: Software Development :: Code Generators'), | ||||||||||||||
('Classifier', 'Topic :: Software Development :: Build Tools'), | ||||||||||||||
('Classifier', 'Programming Language :: Other'), | ||||||||||||||
('Classifier', 'Programming Language :: Other Scripting Engines'), | ||||||||||||||
agriyakhetarpal marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||
('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 commentThe 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 commentThe 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 commentThe 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 commentThe 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't access a Python version that old unless I use |
||||||||||||||
], | ||||||||||||||
description=description, | ||||||||||||||
contents=contents, | ||||||||||||||
) | ||||||||||||||
|
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
anduv
, 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.