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:
- OPENSSL_VERSION: 1.1.1v
- POSTGRES_VERSION: 15.3
- OPENSSL_VERSION: 1.1.1w
- POSTGRES_VERSION: 16.0
NOTE: to zap the cache manually you can also use:

View File

@ -24,8 +24,8 @@ environment:
WORKFLOW: packages
OPENSSL_VERSION: "1_1_1v"
POSTGRES_VERSION: "15_3"
OPENSSL_VERSION: "1_1_1w"
POSTGRES_VERSION: "16_0"
PSYCOPG2_TESTDB: psycopg2_test
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: "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: "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
OPENSSL_VERSION: "1_1_1v"
POSTGRES_VERSION: "15_3"
OPENSSL_VERSION: "1_1_1w"
POSTGRES_VERSION: "16_0"
PSYCOPG2_TESTDB: psycopg2_test
PSYCOPG2_TESTDB_USER: postgres

View File

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

7
NEWS
View File

@ -1,6 +1,13 @@
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
^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -155,7 +155,8 @@ if [ ! -d "${postgres_dir}" ]; then
# export LD_LIBRARY_PATH="${LIBPQ_BUILD_PREFIX}/lib"
./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
make -C src/interfaces/libpq
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.
set -euo pipefail
set -x
# set -x
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
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -26,6 +30,7 @@ fi
if [[ -x /opt/homebrew/bin/brew ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
else
log "installing brew"
command -v brew > /dev/null || (
# Not necessary: already installed
# xcode-select --install
@ -39,11 +44,12 @@ export PGDATA=/opt/homebrew/var/postgresql@${pg_version}
# Install PostgreSQL, if necessary
command -v pg_config > /dev/null || (
log "installing postgres"
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
# Starting from 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
@ -51,7 +57,8 @@ export PATH=$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH
# brew services start postgresql@${pg_version}
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
@ -59,6 +66,7 @@ fi
for ver3 in $python_versions; do
ver2=$(echo $ver3 | sed 's/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/')
command -v python${ver2} > /dev/null || (
log "installing Python $ver3"
(cd /tmp &&
curl -fsSl -O \
https://www.python.org/ftp/python/${ver3}/python-${ver3}-macos11.pkg)
@ -68,12 +76,16 @@ done
# Create a virtualenv where to work
if [[ ! -x .venv/bin/python ]]; then
log "creating a virtualenv"
python3 -m venv .venv
fi
log "installing cibuildwheel"
source .venv/bin/activate
pip install cibuildwheel
log "building wheels"
# Build the binary packages
export CIBW_PLATFORM=macos
export CIBW_ARCHS=arm64

View File

@ -2,6 +2,8 @@
# 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
#
# The PG_VERSION env var must be set to a Postgres major version (e.g. 16).
set -euo pipefail
set -x
@ -9,7 +11,7 @@ set -x
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
prjdir="$( cd "${dir}/../.." && pwd )"
brew install gnu-sed postgresql@15
brew install gnu-sed postgresql@${PG_VERSION}
# Start the database for testing
brew services start postgresql

View File

@ -44,7 +44,7 @@ except ImportError:
# Take a look at https://www.python.org/dev/peps/pep-0440/
# 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