Daniele Varrazzo 2023-09-28 09:16:38 +02:00
parent 921510d5be
commit b39d5d6492
9 changed files with 42 additions and 20 deletions

View File

@ -8,8 +8,8 @@ To invalidate the cache, update this file and check it into git.
Currently used modules built in the cache: Currently used modules built in the cache:
- OPENSSL_VERSION: 1.1.1v - OPENSSL_VERSION: 1.1.1w
- POSTGRES_VERSION: 15.3 - POSTGRES_VERSION: 16.0
NOTE: to zap the cache manually you can also use: NOTE: to zap the cache manually you can also use:

View File

@ -24,8 +24,8 @@ environment:
WORKFLOW: packages WORKFLOW: packages
OPENSSL_VERSION: "1_1_1v" OPENSSL_VERSION: "1_1_1w"
POSTGRES_VERSION: "15_3" POSTGRES_VERSION: "16_0"
PSYCOPG2_TESTDB: psycopg2_test PSYCOPG2_TESTDB: psycopg2_test
PSYCOPG2_TESTDB_USER: postgres PSYCOPG2_TESTDB_USER: postgres

View File

@ -16,13 +16,11 @@ environment:
- {PY_VER: "38", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015} - {PY_VER: "38", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
- {PY_VER: "37", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015} - {PY_VER: "37", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
- {PY_VER: "37", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015} - {PY_VER: "37", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
- {PY_VER: "36", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
- {PY_VER: "36", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
WORKFLOW: tests WORKFLOW: tests
OPENSSL_VERSION: "1_1_1v" OPENSSL_VERSION: "1_1_1w"
POSTGRES_VERSION: "15_3" POSTGRES_VERSION: "16_0"
PSYCOPG2_TESTDB: psycopg2_test PSYCOPG2_TESTDB: psycopg2_test
PSYCOPG2_TESTDB_USER: postgres PSYCOPG2_TESTDB_USER: postgres

View File

@ -56,8 +56,8 @@ jobs:
if: true if: true
env: env:
LIBPQ_VERSION: "15.3" LIBPQ_VERSION: "16.0"
OPENSSL_VERSION: "1.1.1v" OPENSSL_VERSION: "1.1.1w"
strategy: strategy:
fail-fast: false fail-fast: false
@ -81,7 +81,7 @@ jobs:
key: libpq-${{ env.LIBPQ_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }} key: libpq-${{ env.LIBPQ_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
- name: Build wheels - name: Build wheels
uses: pypa/cibuildwheel@v2.14.1 uses: pypa/cibuildwheel@v2.16.1
env: env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014
@ -143,7 +143,7 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Build wheels - name: Build wheels
uses: pypa/cibuildwheel@v2.14.1 uses: pypa/cibuildwheel@v2.16.1
env: env:
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}} CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
CIBW_ARCHS_MACOS: x86_64 CIBW_ARCHS_MACOS: x86_64
@ -152,9 +152,11 @@ jobs:
export PYTHONPATH={project} && export PYTHONPATH={project} &&
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')" python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
CIBW_ENVIRONMENT: >- CIBW_ENVIRONMENT: >-
PG_VERSION=16
PACKAGE_NAME=psycopg2-binary PACKAGE_NAME=psycopg2-binary
PSYCOPG2_TESTDB=postgres PSYCOPG2_TESTDB=postgres
PSYCOPG2_TEST_FAST=1 PSYCOPG2_TEST_FAST=1
PATH="/usr/local/opt/postgresql@${PG_VERSION}/bin:$PATH"
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3

7
NEWS
View File

@ -1,6 +1,13 @@
Current release Current release
--------------- ---------------
What's new in psycopg 2.9.8
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Wheel package bundled with PostgreSQL 16 libpq in order to add support for
recent features, such as ``sslcertmode``.
What's new in psycopg 2.9.7 What's new in psycopg 2.9.7
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -155,7 +155,8 @@ if [ ! -d "${postgres_dir}" ]; then
# export LD_LIBRARY_PATH="${LIBPQ_BUILD_PREFIX}/lib" # export LD_LIBRARY_PATH="${LIBPQ_BUILD_PREFIX}/lib"
./configure --prefix=${LIBPQ_BUILD_PREFIX} --sysconfdir=/etc/postgresql-common \ ./configure --prefix=${LIBPQ_BUILD_PREFIX} --sysconfdir=/etc/postgresql-common \
--without-readline --with-gssapi --with-openssl --with-pam --with-ldap \ --with-gssapi --with-openssl --with-pam --with-ldap \
--without-readline --without-icu \
CPPFLAGS=-I${LIBPQ_BUILD_PREFIX}/include/ LDFLAGS=-L${LIBPQ_BUILD_PREFIX}/lib CPPFLAGS=-I${LIBPQ_BUILD_PREFIX}/include/ LDFLAGS=-L${LIBPQ_BUILD_PREFIX}/lib
make -C src/interfaces/libpq make -C src/interfaces/libpq
make -C src/bin/pg_config make -C src/bin/pg_config

View File

@ -8,10 +8,14 @@
# so it can pretty much only be executed by a sudo user as it is. # so it can pretty much only be executed by a sudo user as it is.
set -euo pipefail set -euo pipefail
set -x # set -x
python_versions="3.8.10 3.9.13 3.10.5 3.11.0" python_versions="3.8.10 3.9.13 3.10.5 3.11.0"
pg_version=15 pg_version=16
function log {
echo "$@" >&2
}
# Move to the root of the project # Move to the root of the project
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -26,6 +30,7 @@ fi
if [[ -x /opt/homebrew/bin/brew ]]; then if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)" eval "$(/opt/homebrew/bin/brew shellenv)"
else else
log "installing brew"
command -v brew > /dev/null || ( command -v brew > /dev/null || (
# Not necessary: already installed # Not necessary: already installed
# xcode-select --install # xcode-select --install
@ -39,11 +44,12 @@ export PGDATA=/opt/homebrew/var/postgresql@${pg_version}
# Install PostgreSQL, if necessary # Install PostgreSQL, if necessary
command -v pg_config > /dev/null || ( command -v pg_config > /dev/null || (
log "installing postgres"
brew install postgresql@${pg_version} brew install postgresql@${pg_version}
) )
# After PostgreSQL 15, the bin path is not in the path. # Starting from PostgreSQL 15, the bin path is not in the path.
export PATH=$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH export PATH="$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH"
# Make sure the server is running # Make sure the server is running
@ -51,7 +57,8 @@ export PATH=$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH
# brew services start postgresql@${pg_version} # brew services start postgresql@${pg_version}
if ! pg_ctl status; then if ! pg_ctl status; then
pg_ctl -l /opt/homebrew/var/log/postgresql@${pg_version}.log start log "starting the server"
pg_ctl -l "/opt/homebrew/var/log/postgresql@${pg_version}.log" start
fi fi
@ -59,6 +66,7 @@ fi
for ver3 in $python_versions; do for ver3 in $python_versions; do
ver2=$(echo $ver3 | sed 's/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/') ver2=$(echo $ver3 | sed 's/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/')
command -v python${ver2} > /dev/null || ( command -v python${ver2} > /dev/null || (
log "installing Python $ver3"
(cd /tmp && (cd /tmp &&
curl -fsSl -O \ curl -fsSl -O \
https://www.python.org/ftp/python/${ver3}/python-${ver3}-macos11.pkg) https://www.python.org/ftp/python/${ver3}/python-${ver3}-macos11.pkg)
@ -68,12 +76,16 @@ done
# Create a virtualenv where to work # Create a virtualenv where to work
if [[ ! -x .venv/bin/python ]]; then if [[ ! -x .venv/bin/python ]]; then
log "creating a virtualenv"
python3 -m venv .venv python3 -m venv .venv
fi fi
log "installing cibuildwheel"
source .venv/bin/activate source .venv/bin/activate
pip install cibuildwheel pip install cibuildwheel
log "building wheels"
# Build the binary packages # Build the binary packages
export CIBW_PLATFORM=macos export CIBW_PLATFORM=macos
export CIBW_ARCHS=arm64 export CIBW_ARCHS=arm64

View File

@ -2,6 +2,8 @@
# Configure the environment needed to build wheel packages on Mac OS. # 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 # This script is designed to be used by cibuildwheel as CIBW_BEFORE_ALL_MACOS
#
# The PG_VERSION env var must be set to a Postgres major version (e.g. 16).
set -euo pipefail set -euo pipefail
set -x set -x
@ -9,7 +11,7 @@ set -x
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
prjdir="$( cd "${dir}/../.." && pwd )" prjdir="$( cd "${dir}/../.." && pwd )"
brew install gnu-sed postgresql@15 brew install gnu-sed postgresql@${PG_VERSION}
# Start the database for testing # Start the database for testing
brew services start postgresql brew services start postgresql

View File

@ -44,7 +44,7 @@ except ImportError:
# Take a look at https://www.python.org/dev/peps/pep-0440/ # Take a look at https://www.python.org/dev/peps/pep-0440/
# for a consistent versioning pattern. # for a consistent versioning pattern.
PSYCOPG_VERSION = '2.9.7' PSYCOPG_VERSION = '2.9.8'
# note: if you are changing the list of supported Python version please fix # note: if you are changing the list of supported Python version please fix