changeset 52209:4d825ad10840 stable

wheels: factor the core of Linux wheel building into a script This will make it easy to reuse in the release process while making sure we build the wheel the same way as in the CI.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 13 Nov 2024 04:20:54 +0100
parents b8efa9013d3f
children 4b9cf9924cd7
files contrib/build-one-linux-wheel.sh contrib/heptapod-ci.yml
diffstat 2 files changed, 29 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/build-one-linux-wheel.sh	Wed Nov 13 04:20:54 2024 +0100
@@ -0,0 +1,28 @@
+#!/bin/bash
+# build a single linux wheel within a prepared imaged based on manylinux images
+#
+#
+#
+set -eu
+
+# enforce that the translation are built
+export MERCURIAL_SETUP_FORCE_TRANSLATIONS=1
+
+if [ $# -lt 2 ]; then
+    echo "usage $0 PYTHONTAG DEST_DIR" >&2
+    echo "" >&2
+    echo 'PYTHONTAG should be of the form "cp310-cp310"' >&2
+    exit 64
+fi
+py_tag=$1
+destination_directory=$2
+
+
+tmp_wheel_dir=./tmp-wheelhouse
+
+if [ -e $tmp_wheel_dir ]; then
+    rm -rf $tmp_wheel_dir
+fi
+/opt/python/$py_tag/bin/python setup.py bdist_wheel --dist-dir $tmp_wheel_dir
+# adjust it to make it universal
+auditwheel repair $tmp_wheel_dir/*.whl -w $destination_directory
--- a/contrib/heptapod-ci.yml	Sat Nov 09 01:31:14 2024 +0100
+++ b/contrib/heptapod-ci.yml	Wed Nov 13 04:20:54 2024 +0100
@@ -63,8 +63,7 @@
     - test -n "$WHEEL_TYPE"
     - echo $FLAVOR
     - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
-    - /opt/python/$BUILD_PY_ID/bin/python setup.py bdist_wheel --dist-dir tmp-wheelhouse
-    - auditwheel repair tmp-wheelhouse/*.whl -w wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
+    - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
   artifacts:
     paths:
       - wheels/