11
4
Fork
You've already forked zig-pypi
1
The Zig programming language, packaged for PyPI. https://pypi.org/project/ziglang
  • Python 100%
2026年05月11日 03:01:02 +02:00
.forgejo/workflows Do the same for Linux? 2026年05月11日 03:01:02 +02:00
dist Initial commit. 2021年07月12日 16:20:25 +00:00
.gitignore Add wheels to .gitignore. 2024年04月25日 12:46:34 +00:00
LICENSE.txt Initial commit. 2021年07月12日 16:20:25 +00:00
make_wheels.py Revert "Support PEP 794" 2026年05月10日 08:49:50 +00:00
README.md CI: update after migration to Codeberg. 2026年05月09日 00:40:05 +00:00
README.pypi.md Add a python-zig entry point, for use with uv etc. 2025年06月01日 19:41:24 +00:00

Zig PyPI distribution

This repository contains the script used to repackage the releases of the Zig programming language as Python binary wheels. This document is intended for maintainers; see the package README for rationale and usage instructions.

The repackaged artifacts are published as the ziglang PyPI package.

Preparation

The script requires Python 3.9 and later and a PEP 723 compatible script runner, such as pipx, pdm, hatch, uv, or similar. Please refer to their documentation for installation instructions.

Building wheels

Run the repackaging script. Here's an example invocation with pdm:

$ pdm run make_wheels.py --help
usage: make_wheels.py [-h] [--version VERSION] [--suffix SUFFIX] [--outdir OUTDIR]
 [--platform {x86_64-windows,x86_64-macos,aarch64-macos,i386-linux,x86-linux,x86_64-linux,aarch64-linux,armv7a-linux}]
Repackage official Zig downloads as Python wheels
options:
 -h, --help show this help message and exit
 --version VERSION version to package, use `latest` for latest release, `master` for nightly build
 --suffix SUFFIX wheel version suffix
 --outdir OUTDIR target directory
 --platform {x86_64-windows,x86_64-macos,aarch64-macos,i386-linux,x86-linux,x86_64-linux,aarch64-linux,armv7a-linux}
 platform to build for, can be repeated

This command will download the Zig release archives for every supported platform and convert them to binary wheels, which are placed under dist/. The Zig version and platforms can be passed as arguments.

The process of converting release archives to binary wheels is deterministic, and the output of the script should be bit-for-bit identical regardless of the environment and platform it runs under. To this end, it prints the SHA256 hashes of inputs and outputs; the hashes of the inputs will match the ones on the Zig downloads page, and the hashes of the outputs will match the ones on the PyPI downloads page.

Uploading wheels to PyPI

Trigger the publishing workflow from this repository manually (requires authorization) with the necessary inputs as mentioned in the workflow file or in the GitHub Actions UI. The wheels are checked with twine before they are uploaded.

The workflow will upload the wheels to PyPI to make them available for installation. It is possible to trigger it multiple times to upload wheels for different versions or platforms.

Verifying the provenance of wheels uploaded to PyPI

To ensure that the wheels published on PyPI correspond to genuine Zig release binaries, generate the wheel(s) you are interested in and verify that the checksums of the resulting wheels match the checksums of wheels published on PyPI.

In the past, we used the GitHub Actions Attestations feature, but nothing equivalent is available on Codeberg.

License

This script is distributed under the terms of the MIT (Expat) license.

Please refer to the Zig license for the terms of use of the Zig programming language itself, or look in the .dist-info/licenses/ directory of the built wheels for individual licenses of the bundled components.