-
-
Notifications
You must be signed in to change notification settings - Fork 143
fix: produce correct python wheel metadata #8632
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,16 @@ def metadata_contents(version): | |
| """ | ||
|
|
||
|
|
||
| def wheel_contents(tag): | ||
| """Render the WHEEL metadata for a filename tag.""" | ||
| interpreter, abi, platforms = tag.split("-") | ||
| lines = ["Wheel-Version: 1.0", "Root-Is-Purelib: false"] | ||
| lines += [ | ||
| f"Tag: {interpreter}-{abi}-{platform}" for platform in platforms.split(".") | ||
| ] | ||
| return "\n".join(lines) + "\n" | ||
|
|
||
|
|
||
| def build_wheel(version, binary, tag, windows=False): | ||
| filename = f"deltachat_rpc_server-{version}-{tag}.whl" | ||
|
|
||
|
|
@@ -60,7 +70,7 @@ def main(): | |
| ) | ||
| wheel.writestr( | ||
| f"deltachat_rpc_server-{version}.dist-info/WHEEL", | ||
| "Wheel-Version: 1.0\nRoot-Is-Purelib: false\nTag: {tag}", | ||
|
Contributor
Author
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. the lost "f" string means that "{tag}" is in all so far published python wheels. Usually pip derives things from filenames but some tooling actually reads the wheel metadata (repackers or so, can't remember). |
||
| wheel_contents(tag), | ||
| ) | ||
| wheel.writestr( | ||
| f"deltachat_rpc_server-{version}.dist-info/entry_points.txt", | ||
|
|
@@ -87,7 +97,11 @@ def main(): | |
| def main(): | ||
| with Path("Cargo.toml").open("rb") as fp: | ||
| cargo_manifest = tomllib.load(fp) | ||
| version = cargo_manifest["package"]["version"] | ||
|
|
||
| # Cargo's SEMVER "-dev" suffix is not a PEP 440 version, | ||
| # so translate to make wheel tooling and metadata writing happy. | ||
| version = cargo_manifest["package"]["version"].replace("-dev", ".dev0") | ||
|
|
||
| arch = sys.argv[1] | ||
| executable = sys.argv[2] | ||
| tags = arch2tags[arch] | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Does this test work for you?
I tried with and without the fix, and get the same result:
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 downloaded https://github.com/chatmail/core/releases/download/v2.59.0/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl and can reproduce this:
wheelpackage version is 0.48.0There 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.
On v2.59.0 tag:
Uh oh!
There was an error while loading. Please reload this page.
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.
Maybe the problem is
-devin the name, with-devversions it fails differently (like in the first message).ZIP archive contents looks like this: