From 35864e0280effac8e09a00eef339f94d78ba00fc Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Tue, 25 Oct 2022 16:58:23 +0200 Subject: [PATCH] chore: upgrade binary dependencies to libpq 15.0, openssl 1.1.1r --- .github/workflows/packages.yml | 4 ++-- docs/news.rst | 1 + tools/build/build_libpq.sh | 4 ++-- tools/build/build_macos_arm64.sh | 29 +++++++++++++++++++---------- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/packages.yml b/.github/workflows/packages.yml index fcef42550..cd288e751 100644 --- a/.github/workflows/packages.yml +++ b/.github/workflows/packages.yml @@ -81,8 +81,8 @@ jobs: runs-on: ubuntu-latest env: - LIBPQ_VERSION: "14.4" - OPENSSL_VERSION: "1.1.1q" + LIBPQ_VERSION: "15.0" + OPENSSL_VERSION: "1.1.1r" strategy: fail-fast: false diff --git a/docs/news.rst b/docs/news.rst index e4b1de424..18d82b4ec 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -15,6 +15,7 @@ Psycopg 3.1.4 (unreleased) - Include :ref:`error classes ` defined in PostgreSQL 15. - Add support for Python 3.11 (:ticket:`#305`). +- Build binary packages with libpq from PostgreSQL 15.0. Current release diff --git a/tools/build/build_libpq.sh b/tools/build/build_libpq.sh index 612439fea..4cc79af2d 100755 --- a/tools/build/build_libpq.sh +++ b/tools/build/build_libpq.sh @@ -7,10 +7,10 @@ set -x # Last release: https://www.postgresql.org/ftp/source/ # IMPORTANT! Change the cache key in packages.yml when upgrading libraries -postgres_version="${LIBPQ_VERSION:-14.4}" +postgres_version="${LIBPQ_VERSION:-15.0}" # last release: https://www.openssl.org/source/ -openssl_version="${OPENSSL_VERSION:-1.1.1q}" +openssl_version="${OPENSSL_VERSION:-1.1.1r}" # last release: https://openldap.org/software/download/ ldap_version="2.6.3" diff --git a/tools/build/build_macos_arm64.sh b/tools/build/build_macos_arm64.sh index 17f48846d..f8c2fd75e 100755 --- a/tools/build/build_macos_arm64.sh +++ b/tools/build/build_macos_arm64.sh @@ -11,7 +11,7 @@ set -euo pipefail set -x python_versions="3.8.10 3.9.13 3.10.5 3.11.0" -postgres_version=14 +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/') @@ -78,7 +87,7 @@ export CIBW_TEST_COMMAND="pytest {project}/tests -m 'not slow and not flakey' -- export PSYCOPG_IMPL=binary export PSYCOPG_TEST_DSN="dbname=postgres" -export PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= ${postgres_version}" -export PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= ${postgres_version}" +export PSYCOPG_TEST_WANT_LIBPQ_BUILD=">= ${pg_version}" +export PSYCOPG_TEST_WANT_LIBPQ_IMPORT=">= ${pg_version}" cibuildwheel psycopg_binary -- 2.47.2