Fix Python package publishing script

This commit is contained in:
Christopher Berner 2023-11-25 10:45:23 -08:00
parent 59989bf351
commit 4670feb3d6
2 changed files with 13 additions and 8 deletions

@ -44,7 +44,7 @@ release_py: pre
.PHONY: publish_py
publish_py: test_py
docker pull quay.io/pypa/manylinux2014_x86_64
docker run -it --rm -v $(shell pwd):/raptorq quay.io/pypa/manylinux2014_x86_64 /raptorq/py_publish.sh
docker run -it --rm -v $(shell pwd):/raptorq-ro:ro quay.io/pypa/manylinux2014_x86_64 /raptorq-ro/py_publish.sh
.PHONY: install_py
install_py: pre

@ -1,13 +1,18 @@
#!/bin/bash
PYTHON3=/opt/python/cp311-cp311/bin/python3
cp -r /raptorq-ro /raptorq
cd /raptorq
yum install -y python3-pip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=1.60.0
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=$(cat ./rust-toolchain)
source $HOME/.cargo/env
pip3 install toml
pip3 install maturin
cd /tmp
$PYTHON3 -m venv venv
cd /raptorq
source /tmp/venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install 'maturin>=1.0,<2.0'
# xargs is just to merge the lines together into a single line
maturin publish --cargo-extra-args="--features python" \
-i $(ls -1 /opt/python/*/bin/python3 | xargs | sed 's/ / -i /g')
python3 -m maturin publish