Skip to content

Commit 4c74dce

Browse files
Further fix/improve etc/build-wheels.sh
1 parent 523a9ba commit 4c74dce

File tree

1 file changed

+10
-21
lines changed

1 file changed

+10
-21
lines changed

etc/build-wheels.sh

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,10 @@
44
set -e
55
set -o pipefail
66

7-
if [ "x$PYTHON" != x ] ; then
8-
:
9-
elif command -v python >/dev/null 2>&1; then
10-
PYTHON=python
11-
elif command -v python3 >/dev/null 2>&1; then
12-
PYTHON=python3
13-
else
14-
echo -e "Python not found, please install it and/or set the PYTHON environment variable to the path of a python executable"
15-
exit 1
16-
fi
17-
18-
echo -e "Using PYTHON = '$PYTHON'"
19-
20-
LIBSEMIGROUPS_PYBIND11_VERSION="$($PYTHON etc/version.py)"
21-
MACOSX_VERSION="$($PYTHON etc/mac_os_version.py)"
22-
echo -e "Building wheels for libsemigroups_pybind11 v$LIBSEMIGROUPS_PYBIND11_VERSION ($MACOSX_VERSION)"
23-
exit 1
7+
# This script requires that python 3.8, 3.9, and 3.10 are installed by homebrew.
8+
# If you've updated your OS recently, then it's also necessary to update the
9+
# installations of python so that they are built against the same version of
10+
# the OS. Building the wheels will fail if this doesn't happen.
2411

2512
PYTHON_VERSIONS=( "3.8" "3.9" "3.10" )
2613

@@ -37,15 +24,17 @@ mkdir -p wheelhouse
3724

3825
for PYTHON_VERSION in "${PYTHON_VERSIONS[@]}"; do
3926
PY="/opt/homebrew/opt/python@$PYTHON_VERSION/bin/python$PYTHON_VERSION"
27+
LIBSEMIGROUPS_PYBIND11_VERSION="$($PY etc/version.py)"
28+
MACOSX_VERSION="$($PY etc/mac_os_version.py)"
4029
WHEEL_PY_VERSION=$(echo "cp$PYTHON_VERSION" | sed 's/\.//')
4130
WHEEL_NAME="libsemigroups_pybind11-$LIBSEMIGROUPS_PYBIND11_VERSION-$WHEEL_PY_VERSION-$WHEEL_PY_VERSION-$MACOSX_VERSION.whl"
31+
echo -e "\033[1mBuilding wheel $WHEEL_NAME ...\033[0m"
4232
"$PY" -m pip wheel .
4333
delocate-wheel --require-archs arm64 -w wheelhouse -v "$WHEEL_NAME"
34+
echo -e "\033[1mSuccess for $WHEEL_NAME !!!\033[0m"
4435
done
4536

4637
for WHEEL in wheelhouse/*; do
47-
if [ -f "wheelhouse/$WHEEL" ]; then
48-
echo "twine upload --repository pypi wheelhouse/$WHEEL"
49-
twine upload --repository pypi wheelhouse/$WHEEL
50-
fi
38+
echo -e "twine upload --repository pypi wheelhouse/$WHEEL"
39+
twine upload --repository pypi wheelhouse/$WHEEL
5140
done

0 commit comments

Comments
 (0)