Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Python 3.13 wheels #1729

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: Build packages
on:
- push
- workflow_dispatch


Expand All @@ -27,6 +28,7 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sdist-${{ matrix.package_name }}
path: |
dist/*.tar.gz

Expand Down Expand Up @@ -64,7 +66,7 @@ jobs:
matrix:
platform: [manylinux, musllinux]
arch: [x86_64, i686, aarch64, ppc64le]
pyver: [cp37, cp38, cp39, cp310, cp311, cp312]
pyver: [cp37, cp38, cp39, cp310, cp311, cp312, cp313]

runs-on: ubuntu-latest
steps:
Expand All @@ -81,7 +83,7 @@ jobs:
key: libpq-${{ env.LIBPQ_VERSION }}-${{ matrix.platform }}-${{ matrix.arch }}

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21.0
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MANYLINUX_I686_IMAGE: manylinux2014
Expand Down Expand Up @@ -110,6 +112,7 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: linux-${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}}
path: ./wheelhouse/*.whl

services:
Expand All @@ -128,30 +131,48 @@ jobs:


build-macos:
runs-on: macos-latest
runs-on: ${{ matrix.platform }}
if: true

strategy:
fail-fast: false
matrix:
# These archs require an Apple M1 runner: [arm64, universal2]
arch: [x86_64]
pyver: [cp37, cp38, cp39, cp310, cp311, cp312]
pyver: [cp38, cp39, cp310, cp311, cp312, cp313]
platform: [macos-12]
include:
- arch: x86_64
pyver: cp37
platform: macos-11
- arch: arm64
pyver: cp310
platform: macos-14
- arch: arm64
pyver: cp311
platform: macos-14
- arch: arm64
pyver: cp312
platform: macos-14
- arch: arm64
pyver: cp313
platform: macos-14

steps:
- name: Checkout repos
uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21.0
env:
CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}}
CIBW_ARCHS_MACOS: x86_64
CIBW_ARCHS_MACOS: ${{matrix.arch}}
CIBW_BEFORE_ALL_MACOS: ./scripts/build/wheel_macos_before_all.sh
CIBW_TEST_COMMAND: >-
export PYTHONPATH={project} &&
python -c "import tests; tests.unittest.main(defaultTest='tests.test_suite')"
CIBW_ENVIRONMENT: >-
MACOSX_DEPLOYMENT_TARGET=12.0
PG_VERSION=16
PACKAGE_NAME=psycopg2-binary
PSYCOPG2_TESTDB=postgres
Expand All @@ -161,4 +182,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: macos-${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}}
path: ./wheelhouse/*.whl
2 changes: 1 addition & 1 deletion scripts/build/build_libpq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ case "$ID" in

alpine)
apk upgrade
apk add --no-cache zlib-dev krb5-dev linux-pam-dev openldap-dev
apk add --no-cache zlib-dev krb5-dev linux-pam-dev openldap-dev libcrypto3
;;

*)
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/wheel_macos_before_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ prjdir="$( cd "${dir}/../.." && pwd )"
brew install gnu-sed postgresql@${PG_VERSION}

# Start the database for testing
brew services start postgresql
brew services start postgresql@${PG_VERSION}

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