Skip to content

fix: produce correct python wheel metadata - #8632

Open
hpk42 wants to merge 1 commit into
mainfrom
hpk/wheel-metadata-fix
Open

fix: produce correct python wheel metadata#8632
hpk42 wants to merge 1 commit into
mainfrom
hpk/wheel-metadata-fix

Conversation

@hpk42

@hpk42 hpk42 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

all published deltachat-rpc-server wheels so far fail "wheel tags"

wheel tags deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl 
Traceback (most recent call last):
  File "/home/hpk/chatmail/core/venv/bin/wheel", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/hpk/chatmail/core/venv/lib/python3.12/site-packages/wheel/_commands/__init__.py", line 167, in main
    args.func(args)
  File "/home/hpk/chatmail/core/venv/lib/python3.12/site-packages/wheel/_commands/__init__.py", line 48, in tags_f
    for name in names:
                ^^^^^
  File "/home/hpk/chatmail/core/venv/lib/python3.12/site-packages/wheel/_commands/__init__.py", line 37, in <genexpr>
    tags(
  File "/home/hpk/chatmail/core/venv/lib/python3.12/site-packages/wheel/_commands/tags.py", line 89, in tags
    abivers = {tag.split("-")[1] for tag in tags}
               ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

all published deltachat-rpc-server wheels so far fail "wheel tags"
and probably other tools.
)
wheel.writestr(
f"deltachat_rpc_server-{version}.dist-info/WHEEL",
"Wheel-Version: 1.0\nRoot-Is-Purelib: false\nTag: {tag}",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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).

run: |
mkdir tagcheck
cp dist/*.whl tagcheck/
nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags tagcheck/*.whl

Copy link
Copy Markdown
Collaborator

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:

$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ ls result
deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ sha256sum result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
578cc4ec9907c2870b92ef811e911042fb8fd085868042891f2fef838a02ae58  result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags result/*.whl
No hash found for file 'deltachat_rpc_server-2.60.0.dist-info/WHEEL'

With the fix on this branch:
$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ sha256sum result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
abcb060bc4f47d5ce743dd648836ef80823448064ecfb5855782f6e382b3ca38  result/deltachat_rpc_server-2.60.0-dev-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ nix run --inputs-from . nixpkgs#python3Packages.wheel -- tags result/*.whl
No hash found for file 'deltachat_rpc_server-2.60.0.dist-info/WHEEL'

Copy link
Copy Markdown
Collaborator

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:

$ wheel tags deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Traceback (most recent call last):
  File "/usr/bin/wheel", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 167, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 48, in tags_f
    for name in names:
                ^^^^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 37, in <genexpr>
    tags(
    ~~~~^
        wheel,
        ^^^^^^
    ...<4 lines>...
        args.remove,
        ^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/tags.py", line 89, in tags
    abivers = {tag.split("-")[1] for tag in tags}
               ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

wheel package version is 0.48.0

Copy link
Copy Markdown
Collaborator

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:

$ nix build .#deltachat-rpc-server-aarch64-linux-wheel
...
$ sha256sum result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
13cd6a7a1af3a49e67d8911ce0a139dcaa286e36f9ac5b6c6408ea4ae93e5cba  result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
$ wheel tags result/deltachat_rpc_server-2.59.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Traceback (most recent call last):
  File "/usr/bin/wheel", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 167, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 48, in tags_f
    for name in names:
                ^^^^^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/__init__.py", line 37, in <genexpr>
    tags(
    ~~~~^
        wheel,
        ^^^^^^
    ...<4 lines>...
        args.remove,
        ^^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.14/site-packages/wheel/_commands/tags.py", line 89, in tags
    abivers = {tag.split("-")[1] for tag in tags}
               ~~~~~~~~~~~~~~^^^
IndexError: list index out of range

@link2xt link2xt Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the problem is -dev in the name, with -dev versions it fails differently (like in the first message).

ZIP archive contents looks like this:

   Date      Time    Attr         Size   Compressed  Name
------------------- ----- ------------ ------------  ------------------------
1980-01-01 00:00:00 .....        16914         5388  deltachat_rpc_server/LICENSE
1980-01-01 00:00:00 .....         1272          618  deltachat_rpc_server/README.md
1980-01-01 00:00:00 .....          147          119  deltachat_rpc_server/__init__.py
1980-01-01 00:00:00 .....     21285824     11340026  deltachat_rpc_server/deltachat-rpc-server
1980-01-01 00:00:00 .....         1419          685  deltachat_rpc_server-2.60.0-dev.dist-info/METADATA
1980-01-01 00:00:00 .....           52           54  deltachat_rpc_server-2.60.0-dev.dist-info/WHEEL
1980-01-01 00:00:00 .....           66           55  deltachat_rpc_server-2.60.0-dev.dist-info/entry_points.txt
1980-01-01 00:00:00 .....          732          427  deltachat_rpc_server-2.60.0.dist-info/RECORD
------------------- ----- ------------ ------------  ------------------------

@link2xt

link2xt commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

This works in the end like this:

$ wheel tags deltachat_rpc_server-2.60.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
deltachat_rpc_server-2.60.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.musllinux_1_1_aarch64.whl

But only if i remove "-dev" from Cargo.toml from where the version is fetched. With "-dev" it produces broken wheel that fails with No hash found for file 'deltachat_rpc_server-2.60.0.dist-info/WHEEL' both with and without this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants