mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
97df29a312
Close #1558.
33 lines
822 B
Bash
Executable File
33 lines
822 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Configure the environment needed to build wheel packages on Mac OS.
|
|
# This script is designed to be used by cibuildwheel as CIBW_BEFORE_ALL_MACOS
|
|
|
|
set -euo pipefail
|
|
set -x
|
|
|
|
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
prjdir="$( cd "${dir}/../.." && pwd )"
|
|
|
|
brew install gnu-sed postgresql@15
|
|
|
|
# Start the database for testing
|
|
brew services start postgresql
|
|
|
|
# Wait for postgres to come up
|
|
for i in $(seq 10 -1 0); do
|
|
eval pg_isready && break
|
|
if [ $i == 0 ]; then
|
|
echo "PostgreSQL service not ready, giving up"
|
|
exit 1
|
|
fi
|
|
echo "PostgreSQL service not ready, waiting a bit, attempts left: $i"
|
|
sleep 5
|
|
done
|
|
|
|
# Replace the package name
|
|
if [[ "${PACKAGE_NAME:-}" ]]; then
|
|
gsed -i "s/^setup(name=\"psycopg2\"/setup(name=\"${PACKAGE_NAME}\"/" \
|
|
"${prjdir}/setup.py"
|
|
fi
|