Skip to content

Commit b39d5d6

Browse files
committed
chore: bundle libpq 16
- psycopg/psycopg#650 - psycopg/psycopg#528
1 parent 921510d commit b39d5d6

File tree

9 files changed

+42
-20
lines changed

9 files changed

+42
-20
lines changed

.appveyor/cache_rebuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ To invalidate the cache, update this file and check it into git.
88

99
Currently used modules built in the cache:
1010

11-
- OPENSSL_VERSION: 1.1.1v
12-
- POSTGRES_VERSION: 15.3
11+
- OPENSSL_VERSION: 1.1.1w
12+
- POSTGRES_VERSION: 16.0
1313

1414

1515
NOTE: to zap the cache manually you can also use:

.appveyor/packages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ environment:
2424

2525
WORKFLOW: packages
2626

27-
OPENSSL_VERSION: "1_1_1v"
28-
POSTGRES_VERSION: "15_3"
27+
OPENSSL_VERSION: "1_1_1w"
28+
POSTGRES_VERSION: "16_0"
2929

3030
PSYCOPG2_TESTDB: psycopg2_test
3131
PSYCOPG2_TESTDB_USER: postgres

.appveyor/tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ environment:
1616
- {PY_VER: "38", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
1717
- {PY_VER: "37", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
1818
- {PY_VER: "37", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
19-
- {PY_VER: "36", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
20-
- {PY_VER: "36", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
2119

2220
WORKFLOW: tests
2321

24-
OPENSSL_VERSION: "1_1_1v"
25-
POSTGRES_VERSION: "15_3"
22+
OPENSSL_VERSION: "1_1_1w"
23+
POSTGRES_VERSION: "16_0"
2624

2725
PSYCOPG2_TESTDB: psycopg2_test
2826
PSYCOPG2_TESTDB_USER: postgres

.github/workflows/packages.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ jobs:
5656
if: true
5757

5858
env:
59-
LIBPQ_VERSION: "15.3"
60-
OPENSSL_VERSION: "1.1.1v"
59+
LIBPQ_VERSION: "16.0"
60+
OPENSSL_VERSION: "1.1.1w"
6161

6262
strategy:
6363
fail-fast: false
@@ -81,7 +81,7 @@ jobs:
8181
key: libpq-${{ env.LIBPQ_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
8282

8383
- name: Build wheels
84-
uses: pypa/cibuildwheel@v2.14.1
84+
uses: pypa/cibuildwheel@v2.16.1
8585
env:
8686
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
8787
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
@@ -143,7 +143,7 @@ jobs:
143143
uses: actions/checkout@v3
144144

145145
- name: Build wheels
146-
uses: pypa/cibuildwheel@v2.14.1
146+
uses: pypa/cibuildwheel@v2.16.1
147147
env:
148148
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
149149
CIBW_ARCHS_MACOS: x86_64
@@ -152,9 +152,11 @@ jobs:
152152
export PYTHONPATH={project} &&
153153
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
154154
CIBW_ENVIRONMENT: >-
155+
PG_VERSION=16
155156
PACKAGE_NAME=psycopg2-binary
156157
PSYCOPG2_TESTDB=postgres
157158
PSYCOPG2_TEST_FAST=1
159+
PATH="/usr/local/opt/postgresql@${PG_VERSION}/bin:$PATH"
158160
159161
- name: Upload artifacts
160162
uses: actions/upload-artifact@v3

NEWS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Current release
22
---------------
33

4+
What's new in psycopg 2.9.8
5+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
- Wheel package bundled with PostgreSQL 16 libpq in order to add support for
8+
recent features, such as ``sslcertmode``.
9+
10+
411
What's new in psycopg 2.9.7
512
^^^^^^^^^^^^^^^^^^^^^^^^^^^
613

scripts/build/build_libpq.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ if [ ! -d "${postgres_dir}" ]; then
155155
# export LD_LIBRARY_PATH="${LIBPQ_BUILD_PREFIX}/lib"
156156

157157
./configure --prefix=${LIBPQ_BUILD_PREFIX} --sysconfdir=/etc/postgresql-common \
158-
--without-readline --with-gssapi --with-openssl --with-pam --with-ldap \
158+
--with-gssapi --with-openssl --with-pam --with-ldap \
159+
--without-readline --without-icu \
159160
CPPFLAGS=-I${LIBPQ_BUILD_PREFIX}/include/ LDFLAGS=-L${LIBPQ_BUILD_PREFIX}/lib
160161
make -C src/interfaces/libpq
161162
make -C src/bin/pg_config

scripts/build/build_macos_arm64.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
# so it can pretty much only be executed by a sudo user as it is.
99

1010
set -euo pipefail
11-
set -x
11+
# set -x
1212

1313
python_versions="3.8.10 3.9.13 3.10.5 3.11.0"
14-
pg_version=15
14+
pg_version=16
15+
16+
function log {
17+
echo "$@" >&2
18+
}
1519

1620
# Move to the root of the project
1721
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -26,6 +30,7 @@ fi
2630
if [[ -x /opt/homebrew/bin/brew ]]; then
2731
eval "$(/opt/homebrew/bin/brew shellenv)"
2832
else
33+
log "installing brew"
2934
command -v brew > /dev/null || (
3035
# Not necessary: already installed
3136
# xcode-select --install
@@ -39,26 +44,29 @@ export PGDATA=/opt/homebrew/var/postgresql@${pg_version}
3944

4045
# Install PostgreSQL, if necessary
4146
command -v pg_config > /dev/null || (
47+
log "installing postgres"
4248
brew install postgresql@${pg_version}
4349
)
4450

45-
# After PostgreSQL 15, the bin path is not in the path.
46-
export PATH=$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH
51+
# Starting from PostgreSQL 15, the bin path is not in the path.
52+
export PATH="$(ls -d1 /opt/homebrew/Cellar/postgresql@${pg_version}/*/bin):$PATH"
4753

4854
# Make sure the server is running
4955

5056
# Currently not working
5157
# brew services start postgresql@${pg_version}
5258

5359
if ! pg_ctl status; then
54-
pg_ctl -l /opt/homebrew/var/log/postgresql@${pg_version}.log start
60+
log "starting the server"
61+
pg_ctl -l "/opt/homebrew/var/log/postgresql@${pg_version}.log" start
5562
fi
5663

5764

5865
# Install the Python versions we want to build
5966
for ver3 in $python_versions; do
6067
ver2=$(echo $ver3 | sed 's/\([^\.]*\)\(\.[^\.]*\)\(.*\)/\1\2/')
6168
command -v python${ver2} > /dev/null || (
69+
log "installing Python $ver3"
6270
(cd /tmp &&
6371
curl -fsSl -O \
6472
https://www.python.org/ftp/python/${ver3}/python-${ver3}-macos11.pkg)
@@ -68,12 +76,16 @@ done
6876

6977
# Create a virtualenv where to work
7078
if [[ ! -x .venv/bin/python ]]; then
79+
log "creating a virtualenv"
7180
python3 -m venv .venv
7281
fi
7382

83+
log "installing cibuildwheel"
7484
source .venv/bin/activate
7585
pip install cibuildwheel
7686

87+
log "building wheels"
88+
7789
# Build the binary packages
7890
export CIBW_PLATFORM=macos
7991
export CIBW_ARCHS=arm64

scripts/build/wheel_macos_before_all.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
# Configure the environment needed to build wheel packages on Mac OS.
44
# This script is designed to be used by cibuildwheel as CIBW_BEFORE_ALL_MACOS
5+
#
6+
# The PG_VERSION env var must be set to a Postgres major version (e.g. 16).
57

68
set -euo pipefail
79
set -x
810

911
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1012
prjdir="$( cd "${dir}/../.." && pwd )"
1113

12-
brew install gnu-sed postgresql@15
14+
brew install gnu-sed postgresql@${PG_VERSION}
1315

1416
# Start the database for testing
1517
brew services start postgresql

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
# Take a look at https://www.python.org/dev/peps/pep-0440/
4545
# for a consistent versioning pattern.
4646

47-
PSYCOPG_VERSION = '2.9.7'
47+
PSYCOPG_VERSION = '2.9.8'
4848

4949

5050
# note: if you are changing the list of supported Python version please fix

0 commit comments

Comments
 (0)