ziglang / zig-pypi

The Zig programming language, packaged for PyPI
https://pypi.org/project/ziglang/
MIT License
148 stars 16 forks source link

Publish wheels for musllinux #9

Closed zmanji closed 1 year ago

zmanji commented 1 year ago

On Alpine linux running:

pip install 'ziglang==0.10.0'

Fails with:

ERROR: Could not find a version that satisfies the requirement ziglang==0.10.0 (from versions: 0.0.0)
ERROR: No matching distribution found for ziglang==0.10.0

I think this is because the publishing script only releases manylinux wheels and not musllinux wheels https://github.com/ziglang/zig-pypi/blob/8d37e955e3af0c0d88851e8283081b89b074e3bc/make_wheels.py#L115-L122

Since the linux- binaries published on the zig website are statically linked I think changing

    'linux-x86_64':   'manylinux_2_12_x86_64.manylinux2010_x86_64',

to

    'linux-x86_64':   'manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64',

to the publishing script should work.

I tested this out locally by downloading ziglang-0.10.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.whl and renaming it to ziglang-0.10.0-py3-none-manylinux_2_12_x86_64.manylinux2010_x86_64.musllinux_1_1_x86_64.whl and then running python3 -m ziglang worked fine.

Publishing this wheel means running pip install maturin[zig] on Alpine linux will work as well.

whitequark commented 1 year ago

Done: https://pypi.org/project/ziglang/0.10.0.post1/