diff --git a/make_wheels.py b/make_wheels.py index 3330659..bacfd75 100644 --- a/make_wheels.py +++ b/make_wheels.py @@ -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"), + ('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'), + ('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'), + ], description=description, contents=contents, )