88# so it can pretty much only be executed by a sudo user as it is.
99
1010set -euo pipefail
11- set -x
11+ # set -x
1212
1313python_versions=" 3.8.10 3.9.13 3.10.5 3.11.0"
14- pg_version=15
14+ pg_version=16
15+
16+ function log {
17+ echo " $@ " >&2
18+ }
1519
1620# Move to the root of the project
1721dir=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
2630if [[ -x /opt/homebrew/bin/brew ]]; then
2731 eval " $( /opt/homebrew/bin/brew shellenv) "
2832else
33+ log " installing brew"
2934 command -v brew > /dev/null || (
3035 # Not necessary: already installed
3136 # xcode-select --install
@@ -39,26 +44,29 @@ export PGDATA=/opt/homebrew/var/postgresql@${pg_version}
3944
4045# Install PostgreSQL, if necessary
4146command -v pg_config > /dev/null || (
47+ log " installing postgres"
4248 brew install postgresql@${pg_version}
4349)
4450
45- # After PostgreSQL 15, the bin path is not in the path.
46- export PATH=$( ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version} /* /bin) :$PATH
51+ # Starting from PostgreSQL 15, the bin path is not in the path.
52+ export PATH=" $( ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version} /* /bin) :$PATH "
4753
4854# Make sure the server is running
4955
5056# Currently not working
5157# brew services start postgresql@${pg_version}
5258
5359if ! pg_ctl status; then
54- pg_ctl -l /opt/homebrew/var/log/postgresql@${pg_version} .log start
60+ log " starting the server"
61+ pg_ctl -l " /opt/homebrew/var/log/postgresql@${pg_version} .log" start
5562fi
5663
5764
5865# Install the Python versions we want to build
5966for ver3 in $python_versions ; do
6067 ver2=$( echo $ver3 | sed ' s/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/' )
6168 command -v python${ver2} > /dev/null || (
69+ log " installing Python $ver3 "
6270 (cd /tmp &&
6371 curl -fsSl -O \
6472 https://www.python.org/ftp/python/${ver3} /python-${ver3} -macos11.pkg)
6876
6977# Create a virtualenv where to work
7078if [[ ! -x .venv/bin/python ]]; then
79+ log " creating a virtualenv"
7180 python3 -m venv .venv
7281fi
7382
83+ log " installing cibuildwheel"
7484source .venv/bin/activate
7585pip install cibuildwheel
7686
87+ log " building wheels"
88+
7789# Build the binary packages
7890export CIBW_PLATFORM=macos
7991export CIBW_ARCHS=arm64
0 commit comments