diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2022-10-27 00:41:09 +0200 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2022-10-27 00:41:09 +0200 |
commit | 3182ea2303f4c7fb52c0f17018ddf98aa03ab4c8 (patch) | |
tree | d055b8e1497413785861e9cde62318bfcbad88e4 | |
parent | ea32730a39a1c7d613ec1a3789053d650f144b2e (diff) | |
download | psycopg2-3182ea2303f4c7fb52c0f17018ddf98aa03ab4c8.tar.gz |
ci: adapt macOS arm64 build script to changes in Python 3.11 and PostgreSQL 15
-rwxr-xr-x | scripts/build/build_macos_arm64.sh | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/scripts/build/build_macos_arm64.sh b/scripts/build/build_macos_arm64.sh index 9fde430..32c6f2d 100755 --- a/scripts/build/build_macos_arm64.sh +++ b/scripts/build/build_macos_arm64.sh @@ -10,8 +10,8 @@ set -euo pipefail set -x -python_versions="3.8.10 3.9.13 3.10.5 3.11" -postgres_version=15 +python_versions="3.8.10 3.9.13 3.10.5 3.11.0" +pg_version=15 # Move to the root of the project dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -35,17 +35,26 @@ else eval "$(/opt/homebrew/bin/brew shellenv)" fi +export PGDATA=/opt/homebrew/var/postgresql@${pg_version} + # Install PostgreSQL, if necessary command -v pg_config > /dev/null || ( - brew install postgresql@${postgres_version} - # Currently not working - # brew services start postgresql@${postgres_version} - pg_ctl \ - -D /opt/homebrew/var/postgresql@${postgres_version} \ - -l /opt/homebrew/var/log/postgresql@${postgres_version}.log \ - start + brew install postgresql@${pg_version} ) +# After PostgreSQL 15, the bin path is not in the path. +export PATH=$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH + +# Make sure the server is running + +# Currently not working +# brew services start postgresql@${pg_version} + +if ! pg_ctl status; then + pg_ctl -l /opt/homebrew/var/log/postgresql@${pg_version}.log start +fi + + # Install the Python versions we want to build for ver3 in $python_versions; do ver2=$(echo $ver3 | sed 's/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/') @@ -68,7 +77,7 @@ pip install cibuildwheel # Build the binary packages export CIBW_PLATFORM=macos export CIBW_ARCHS=arm64 -export CIBW_BUILD='cp{38,39,310}-*' +export CIBW_BUILD='cp{38,39,310,311}-*' export CIBW_TEST_COMMAND='python -c "import tests; tests.unittest.main(defaultTest=\"tests.test_suite\")"' export PSYCOPG2_TESTDB=postgres |