Skip to content

Commit

Permalink
added build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Aug 15, 2024
1 parent e573831 commit 4046d92
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _build-wheels.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -eux
ARCH=$(uname -m)

# see docs: https://setuptools-rust.readthedocs.io/en/latest/building_wheels.html#building-for-multiple-python-versions
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"

for PYBIN in /opt/python/cp{38,39,310,311,312}*/bin; do
rm -rf /io/build/
"${PYBIN}/pip" install -U setuptools setuptools-rust wheel
"${PYBIN}/pip" wheel /io/ -w /io/dist/ --no-deps
done

for whl in /io/dist/*{cp38,cp39,cp310,cp311,cp312}*_"${ARCH}".whl; do
auditwheel repair "$whl" -w /io/dist/
done

for PYBIN in /opt/python/cp{38,39,310,311,312}*/bin; do
"${PYBIN}/pip" install entropython -f /io/dist/
done
15 changes: 15 additions & 0 deletions build-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -eux

# create release for multiple python versions with manylinux
docker run --rm -v "$(pwd)":/io quay.io/pypa/manylinux2014_x86_64 bash /io/_build-wheels.sh

# also create a source release with build:
python3 -m pip install -U build
python3 -m build --sdist

# finally do a cross build for arm64:
# For this to work, qemu must be registered with docker. You can do so by running
# docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# (see also: https://github.com/multiarch/qemu-user-static)
docker run --rm -v "$(pwd)":/io quay.io/pypa/manylinux2014_aarch64 bash /io/_build-wheels.sh

0 comments on commit 4046d92

Please sign in to comment.