Skip to content

Commit eaeeb76

Browse files
authored
Merge pull request #1729 from edgarrmondragon/1692-py313-wheels
Build Python 3.13 wheels, drop support for Python 3.7
2 parents f9780aa + 4987362 commit eaeeb76

File tree

12 files changed

+56
-52
lines changed

12 files changed

+56
-52
lines changed

.appveyor/packages.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ environment:
1919
- {PY_VER: "310", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
2020
- {PY_VER: "39", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
2121
- {PY_VER: "39", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
22-
- {PY_VER: "38", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
23-
- {PY_VER: "38", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
24-
- {PY_VER: "37", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
25-
- {PY_VER: "37", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
2622

2723
WORKFLOW: packages
2824

@@ -41,17 +37,14 @@ environment:
4137
PERL5LIB: .
4238

4339
# Select according to the service enabled
44-
POSTGRES_DIR: C:\Program Files\PostgreSQL\9.6\
45-
46-
# The python used in the build process, not the one packages are built for
47-
PYEXE: C:\Python36\python.exe
40+
POSTGRES_DIR: C:\Program Files\PostgreSQL\13\
4841

4942
matrix:
5043
fast_finish: false
5144

5245
services:
5346
# Note: if you change this service also change POSTGRES_DIR
54-
- postgresql96
47+
- postgresql13
5548

5649
cache:
5750
# Rebuild cache if following file changes
@@ -64,23 +57,23 @@ cache:
6457
# Repository gets cloned, Cache is restored
6558

6659
install:
67-
- "%PYEXE% scripts\\build\\appveyor.py install"
60+
- "py scripts\\build\\appveyor.py install"
6861

6962
# PostgreSQL server starts now
7063

7164
build: "off"
7265

7366
build_script:
74-
- "%PYEXE% scripts\\build\\appveyor.py build_script"
67+
- "py scripts\\build\\appveyor.py build_script"
7568

7669
after_build:
77-
- "%PYEXE% scripts\\build\\appveyor.py after_build"
70+
- "py scripts\\build\\appveyor.py after_build"
7871

7972
before_test:
80-
- "%PYEXE% scripts\\build\\appveyor.py before_test"
73+
- "py scripts\\build\\appveyor.py before_test"
8174

8275
test_script:
83-
- "%PYEXE% scripts\\build\\appveyor.py test_script"
76+
- "py scripts\\build\\appveyor.py test_script"
8477

8578
artifacts:
8679
- path: dist\psycopg2-*\*.whl

.appveyor/tests.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ environment:
1414
- {PY_VER: "310", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
1515
- {PY_VER: "39", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
1616
- {PY_VER: "39", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019}
17-
- {PY_VER: "38", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
18-
- {PY_VER: "38", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
19-
- {PY_VER: "37", PY_ARCH: "32", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
20-
- {PY_VER: "37", PY_ARCH: "64", APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015}
2117

2218
WORKFLOW: tests
2319

@@ -36,17 +32,14 @@ environment:
3632
PERL5LIB: .
3733

3834
# Select according to the service enabled
39-
POSTGRES_DIR: C:\Program Files\PostgreSQL\9.6\
40-
41-
# The python used in the build process, not the one packages are built for
42-
PYEXE: C:\Python36\python.exe
35+
POSTGRES_DIR: C:\Program Files\PostgreSQL\13\
4336

4437
matrix:
4538
fast_finish: false
4639

4740
services:
4841
# Note: if you change this service also change POSTGRES_DIR
49-
- postgresql96
42+
- postgresql13
5043

5144
cache:
5245
# Rebuild cache if following file changes
@@ -59,23 +52,23 @@ cache:
5952
# Repository gets cloned, Cache is restored
6053

6154
install:
62-
- "%PYEXE% scripts\\build\\appveyor.py install"
55+
- py scripts\\build\\appveyor.py install"
6356

6457
# PostgreSQL server starts now
6558

6659
build: "off"
6760

6861
build_script:
69-
- "%PYEXE% scripts\\build\\appveyor.py build_script"
62+
- py scripts\\build\\appveyor.py build_script"
7063

7164
after_build:
72-
- "%PYEXE% scripts\\build\\appveyor.py after_build"
65+
- py scripts\\build\\appveyor.py after_build"
7366

7467
before_test:
75-
- "%PYEXE% scripts\\build\\appveyor.py before_test"
68+
- py scripts\\build\\appveyor.py before_test"
7669

7770
test_script:
78-
- "%PYEXE% scripts\\build\\appveyor.py test_script"
71+
- py scripts\\build\\appveyor.py test_script"
7972

8073

8174
# vim: set ts=4 sts=4 sw=4:

.github/workflows/packages.yml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Upload artifacts
2828
uses: actions/upload-artifact@v4
2929
with:
30+
name: sdist-${{ matrix.package_name }}
3031
path: |
3132
dist/*.tar.gz
3233
@@ -64,7 +65,7 @@ jobs:
6465
matrix:
6566
platform: [manylinux, musllinux]
6667
arch: [x86_64, i686, aarch64, ppc64le]
67-
pyver: [cp37, cp38, cp39, cp310, cp311, cp312]
68+
pyver: [cp38, cp39, cp310, cp311, cp312, cp313]
6869

6970
runs-on: ubuntu-latest
7071
steps:
@@ -81,7 +82,7 @@ jobs:
8182
key: libpq-${{ env.LIBPQ_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}
8283

8384
- name: Build wheels
84-
uses: pypa/cibuildwheel@v2.16.2
85+
uses: pypa/cibuildwheel@v2.21.2
8586
env:
8687
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
8788
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
@@ -110,6 +111,7 @@ jobs:
110111
111112
- uses: actions/upload-artifact@v4
112113
with:
114+
name: linux-${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}}
113115
path: ./wheelhouse/*.whl
114116

115117
services:
@@ -128,30 +130,45 @@ jobs:
128130
129131
130132
build-macos:
131-
runs-on: macos-latest
133+
runs-on: macos-${{ matrix.macver }}
132134
if: true
133135

134136
strategy:
135137
fail-fast: false
136138
matrix:
137139
# These archs require an Apple M1 runner: [arm64, universal2]
138140
arch: [x86_64]
139-
pyver: [cp37, cp38, cp39, cp310, cp311, cp312]
141+
pyver: [cp38, cp39, cp310, cp311, cp312, cp313]
142+
macver: ["12"]
143+
include:
144+
- arch: arm64
145+
pyver: cp310
146+
macver: "14"
147+
- arch: arm64
148+
pyver: cp311
149+
macver: "14"
150+
- arch: arm64
151+
pyver: cp312
152+
macver: "14"
153+
- arch: arm64
154+
pyver: cp313
155+
macver: "14"
140156

141157
steps:
142158
- name: Checkout repos
143159
uses: actions/checkout@v4
144160

145161
- name: Build wheels
146-
uses: pypa/cibuildwheel@v2.16.2
162+
uses: pypa/cibuildwheel@v2.21.2
147163
env:
148164
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
149-
CIBW_ARCHS_MACOS: x86_64
165+
CIBW_ARCHS_MACOS: ${{matrix.arch}}
150166
CIBW_BEFORE_ALL_MACOS: ./scripts/build/wheel_macos_before_all.sh
151167
CIBW_TEST_COMMAND: >-
152168
export PYTHONPATH={project} &&
153169
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
154170
CIBW_ENVIRONMENT: >-
171+
MACOSX_DEPLOYMENT_TARGET=${{ matrix.macver }}.0
155172
PG_VERSION=16
156173
PACKAGE_NAME=psycopg2-binary
157174
PSYCOPG2_TESTDB=postgres
@@ -161,4 +178,5 @@ jobs:
161178
- name: Upload artifacts
162179
uses: actions/upload-artifact@v4
163180
with:
181+
name: macos-${{matrix.pyver}}-macos-${{matrix.macver}}_${{matrix.arch}}
164182
path: ./wheelhouse/*.whl

.github/workflows/tests.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,20 @@ jobs:
1313
fail-fast: false
1414
matrix:
1515
include:
16-
- {python: "3.7", postgres: "10"}
1716
- {python: "3.8", postgres: "12"}
1817
- {python: "3.9", postgres: "13"}
1918
- {python: "3.10", postgres: "14"}
2019
- {python: "3.11", postgres: "15"}
2120
- {python: "3.12", postgres: "16"}
22-
- {python: "3.13-dev", postgres: "16"}
21+
- {python: "3.13-dev", postgres: "17"}
2322

2423
# Opposite extremes of the supported Py/PG range, other architecture
25-
- {python: "3.7", postgres: "16", architecture: "x86"}
26-
- {python: "3.8", postgres: "15", architecture: "x86"}
27-
- {python: "3.9", postgres: "14", architecture: "x86"}
28-
- {python: "3.10", postgres: "13", architecture: "x86"}
29-
- {python: "3.11", postgres: "11", architecture: "x86"}
30-
- {python: "3.12", postgres: "10", architecture: "x86"}
31-
- {python: "3.13-dev", postgres: "10", architecture: "x86"}
24+
- {python: "3.8", postgres: "17", architecture: "x86"}
25+
- {python: "3.9", postgres: "16", architecture: "x86"}
26+
- {python: "3.10", postgres: "15", architecture: "x86"}
27+
- {python: "3.11", postgres: "14", architecture: "x86"}
28+
- {python: "3.12", postgres: "13", architecture: "x86"}
29+
- {python: "3.13-dev", postgres: "12", architecture: "x86"}
3230

3331
env:
3432
PSYCOPG2_TESTDB: postgres

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ What's new in psycopg 2.9.10 (unreleased)
55
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

77
- Add support for Python 3.13.
8+
- Drop support for Python 3.7.
89

910

1011
What's new in psycopg 2.9.9

doc/src/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ The current `!psycopg2` implementation supports:
131131
..
132132
NOTE: keep consistent with setup.py and the /features/ page.
133133
134-
- Python versions from 3.7 to 3.12
135-
- PostgreSQL server versions from 7.4 to 16
134+
- Python versions from 3.8 to 3.13
135+
- PostgreSQL server versions from 7.4 to 17
136136
- PostgreSQL client library version from 9.1
137137

138138
.. note::

psycopg/python.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#ifndef PSYCOPG_PYTHON_H
2828
#define PSYCOPG_PYTHON_H 1
2929

30-
#if PY_VERSION_HEX < 0x03070000
31-
#error "psycopg requires Python 3.7"
30+
#if PY_VERSION_HEX < 0x03080000
31+
#error "psycopg requires Python 3.8"
3232
#endif
3333

3434
#include <structmember.h>

scripts/build/appveyor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def configure_postgres():
9999
Set up PostgreSQL config before the service starts.
100100
"""
101101
logger.info("Configuring Postgres")
102+
opt.pg_data_dir.mkdir(parents=True, exist_ok=True)
102103
with (opt.pg_data_dir / 'postgresql.conf').open('a') as f:
103104
# allow > 1 prepared transactions for test cases
104105
print("max_prepared_transactions = 10", file=f)

scripts/build/build_libpq.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ case "$ID" in
3535

3636
alpine)
3737
apk upgrade
38-
apk add --no-cache zlib-dev krb5-dev linux-pam-dev openldap-dev
38+
apk add --no-cache zlib-dev krb5-dev linux-pam-dev openldap-dev openssl-dev
3939
;;
4040

4141
*)

scripts/build/wheel_macos_before_all.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
1212
prjdir="$( cd "${dir}/../.." && pwd )"
1313

1414
brew install gnu-sed postgresql@${PG_VERSION}
15+
brew link --overwrite postgresql@${PG_VERSION}
1516

1617
# Start the database for testing
17-
brew services start postgresql
18+
brew services start postgresql@${PG_VERSION}
1819

1920
# Wait for postgres to come up
2021
for i in $(seq 10 -1 0); do

0 commit comments

Comments
 (0)