Skip to content

Commit

Permalink
Fix Python package publishing script
Browse files Browse the repository at this point in the history
  • Loading branch information
cberner committed Nov 25, 2023
1 parent 59989bf commit 4670feb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 12 additions & 7 deletions py_publish.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 4670feb

Please sign in to comment.