Skip to content

Commit

Permalink
Fix wheel mod
Browse files Browse the repository at this point in the history
  • Loading branch information
virtuald committed Feb 4, 2025
1 parent b5ccbd8 commit 581fc35
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
name: Modify ${{ matrix.package }} wheel
shell: bash
run: |
/build/venv/bin/cross-python whl_mod.py ${{ steps.build.outputs.wheel }}
/build/venv/bin/cross-python whl_mod.py ${{ matrix.package }} ${{ steps.build.outputs.wheel }}
ls dist/*
# Some packages are stupid
Expand Down
9 changes: 5 additions & 4 deletions whl_mod.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def add_requirements_to_wheel(

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("project")
parser.add_argument("wheel")
parser.add_argument("--config", default="packages.toml")

Expand All @@ -111,13 +112,13 @@ def add_requirements_to_wheel(
with open(args.config, "rb") as fp:
cfg = tomllib.load(fp)

project, _ = os.path.basename(args.wheel).split("-", 1)

try:
pkgdata = cfg["packages"][project]
pkgdata = cfg["packages"][args.project]
version = pkgdata["version"]
except KeyError:
parser.error(f"{project} not found in {args.config}")
parser.error(f"{args.project} not found in {args.config}")

project = pkgdata.get("name", args.project)

out_version = pkgdata.get("mod_version", None)
if out_version is None:
Expand Down

0 comments on commit 581fc35

Please sign in to comment.