| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | # Linux wheels are built inside manylinux2014 containers managed by cibuildwheel. |
| 5 | python -m pip install --upgrade pip cibuildwheel twine build |
| 6 | |
| 7 | export CIBW_BUILD="cp310-* cp311-* cp312-* cp313-* cp314-*" |
| 8 | export CIBW_SKIP="*-musllinux_*" |
| 9 | export CIBW_MANYLINUX_X86_64_IMAGE="manylinux2014" |
| 10 | export CIBW_MANYLINUX_AARCH64_IMAGE="manylinux2014" |
| 11 | export CIBW_ENVIRONMENT="VERSION=\"${VERSION}\"" |
| 12 | export CIBW_TEST_REQUIRES="pytest" |
| 13 | export CIBW_TEST_COMMAND="pytest {project}/python/tests" |
| 14 | |
| 15 | python -m cibuildwheel --output-dir wheelhouse |
| 16 | |
| 17 | if [ "$(uname -m)" = "x86_64" ]; then |
| 18 | # Build sdist only once, to avoid duplicate uploads from matrix jobs. |
| 19 | python -m build --sdist --outdir wheelhouse |
| 20 | fi |
| 21 | |
| 22 | if [ "$1" != "testonly" ]; then |
| 23 | # Upload to PyPI |
| 24 | python -m twine upload wheelhouse/* |
| 25 | fi |