4
4
set -e
5
5
set -o pipefail
6
6
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.
24
11
25
12
PYTHON_VERSIONS=( " 3.8" " 3.9" " 3.10" )
26
13
@@ -37,15 +24,17 @@ mkdir -p wheelhouse
37
24
38
25
for PYTHON_VERSION in " ${PYTHON_VERSIONS[@]} " ; do
39
26
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) "
40
29
WHEEL_PY_VERSION=$( echo " cp$PYTHON_VERSION " | sed ' s/\.//' )
41
30
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"
42
32
" $PY " -m pip wheel .
43
33
delocate-wheel --require-archs arm64 -w wheelhouse -v " $WHEEL_NAME "
34
+ echo -e " \033[1mSuccess for $WHEEL_NAME !!!\033[0m"
44
35
done
45
36
46
37
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
51
40
done
0 commit comments