mirror of
https://github.com/chatmail/core.git
synced 2026-09-22 04:58:47 +03:00
fix: produce correct wheel metadata
all published deltachat-rpc-server wheels so far fail "wheel tags" and probably other tools. Translate "dev" cargo-versioning to PEP440-versioning to make CI dev wheel builds reproducable at least for the 11 non-mac targets.
This commit is contained in:
8
.github/workflows/deltachat-rpc-server.yml
vendored
8
.github/workflows/deltachat-rpc-server.yml
vendored
@@ -370,6 +370,14 @@ jobs:
|
||||
- name: List artifacts
|
||||
run: ls -l dist/
|
||||
|
||||
- name: Check that the wheel metadata reads back
|
||||
run: |
|
||||
echo 'You can check a local `nix build` on non-Mac machines against the following checksums.'
|
||||
sha256sum dist/*.whl
|
||||
mkdir tagcheck
|
||||
cp dist/*.whl tagcheck/
|
||||
nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags tagcheck/*.whl
|
||||
|
||||
- name: Upload binaries to the GitHub release
|
||||
if: github.event_name == 'release'
|
||||
env:
|
||||
|
||||
@@ -20,6 +20,16 @@ Description-Content-Type: text/markdown
|
||||
"""
|
||||
|
||||
|
||||
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}",
|
||||
wheel_contents(tag),
|
||||
)
|
||||
wheel.writestr(
|
||||
f"deltachat_rpc_server-{version}.dist-info/entry_points.txt",
|
||||
@@ -87,7 +97,11 @@ arch2tags = {
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user