-
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 II
#26
Implement PEP 639: support for Metadata-Version: 2.4
; Part II
#26
Conversation
Metadata-Version: 2.4
; part IIMetadata-Version: 2.4
; Part II
Metadata-Version: 2.4
; Part IIMetadata-Version: 2.4
; Part II
Ready for review, @whitequark! We should be able to publish wheels with this, too, (such as #25), now that PyPI has support. I think it should all work, but |
Okay, could you please not reformat the entire codebase in a functional PR? |
Yes, reverted it, the diff should be a lot cleaner now. I'll move that to a different/dedicated PR for adding pre-commit hooks if needed. |
I don't really use autoformatters in any of my codebases, so I'd rather avoid that. |
make_wheels.py
Outdated
if missing_licenses: | ||
print(f"\033[93mWarning: the following license files were not found in the Zig archive: {', '.join(sorted(missing_licenses))} " | ||
"\nThis may indicate a change in Zig's license file structure or an error in the listing of license files and/or paths.\033[0m" | ||
) |
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.
What about going through all files in the tarball matching the regex /license/i
and warning if any of them are missing from license_paths
?
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 thought about it, it's not going to be robust enough to cover cases where the license is called "COPYRIGHT" or "COPYING". I left it alone after that, but a partial check sounds good to me.
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.
What about /\b(license|copyright|copying)\b/i
?
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.
Sounds good!
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.
Addressed in 67b9200. I added a larger pattern and the regex caught two more files – added them to the list! :)
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.
That's how you know it was working :D
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, please squash the commits.
8d3aaa8
to
e4b0ea2
Compare
Thanks for the review! Done. |
Thanks! |
You're welcome! Could you please try to upload new wheels to PyPI with this change? That can help check in case we need to change anything else. |
I can't:
|
Ah okay, this solved it:
|
Yes, thanks! I've cross-linked the issue related to this above. It would be great if you could build and publish some of the ppc64le wheels for recent versions so that I can start using them :) |
Actually no, I still can't:
|
I added this from the specs mentioned in the Python Packaging Guide; it looks like the information is incorrect therein in that case... I opened a quick fix in #28. |
Okay, should be uploaded now: https://pypi.org/project/ziglang/0.13.0.post1/#files |
Thank you so much, @whitequark! |
Description
This PR comes in continuation of #24 and resolves a few prior shortcomings in the implementation. Here's a summary of the changes:
The licenses are now copied into a
ziglang-0.X.Y.dist-info/licenses/
folder with their contents intact and the original structure of the licenses in place, i.e.,ziglang/lib/libc/mingw/COPYING
gets copied intoziglang-0.X.Y.dist-info/licenses/ziglang/lib/libc/mingw/COPYING
and so on. This does generate duplicate license files, but I tested this by creating a dummy package using Hatchling as the build backend, which has support for PEP 639, and it does the same thing. Plus, text does compress well, of course. Also,This is no longer an issue, since the paths to the license files are correct indeed (wheels generated by Hatchling preserve the
ziglang/
folder).A simple warning is printed to stdout in the case of license files that go missing when copying – this would be useful in case the Zig source upstream changes the license structure by moving/deleting one or more license files, since we are currently hardcoding the filenames and their paths. The current license structure is accurate for Zig 0.13.0. What it can't do is detect new license files that are not listed in the metadata. That's difficult to do here, but I'm open to thoughts. A pre-commit hook of sorts could be implemented but I need to think about how it would work. We could also write a simple release checklist (
release_checklist.md
) that lists a few things to manually verify before pushing wheels?I also ran
black
on the file in 4573248 to clean up the code quality and style a bit, so this PR is best reviewed with diffs for whitespace changes turned off. But if it doesn't seem effective, we can drop it, too.Additional information
The wheel has not included the
LICENSE.txt
file for this repository in general in previous wheels uploaded to PyPI, so I've decided to not include it here (my understanding is because it's a license for themake_wheels.py
script and not the contents of the wheels). The main license file from the Zig source that accredits the Zig contributors, i.e.,LICENSE
, continues to remain included throughziglang/LICENSE
.