From 69273a9d7a32d7864a7aa0bfc787bad4015dcc68 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Sun, 22 Feb 2026 22:26:14 +0100 Subject: [PATCH 1/6] Build linux/macos arm64/aarch64 wheels on native runners --- .github/workflows/release.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d3c6d26..f691290a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -84,15 +84,21 @@ jobs: with: python-version: "3.x" - name: Install cibuildwheel - run: pip install cibuildwheel==3.3.0 + run: pip install cibuildwheel==3.3.1 - name: Build cibuildwheel matrix id: set-matrix + env: + # skipping pypy for now + CIBW_SKIP: > + pp* run: | MATRIX_INCLUDE=$( { - cibuildwheel --print-build-identifiers --platform linux --archs x86_64,aarch64 | grep cp | jq -nRc '{"only": inputs, "os": "ubuntu-latest"}' \ - && cibuildwheel --print-build-identifiers --platform macos --archs x86_64,arm64 | grep cp | jq -nRc '{"only": inputs, "os": "macos-latest"}' \ - && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | grep cp | jq -nRc '{"only": inputs, "os": "windows-latest"}' + cibuildwheel --print-build-identifiers --platform linux --archs x86_64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04"}' \ + && cibuildwheel --print-build-identifiers --platform linux --archs aarch64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04-arm"}' \ + && cibuildwheel --print-build-identifiers --platform macos --archs x86_64 | jq -nRc '{"only": inputs, "os": "macos-15-intel"}' \ + && cibuildwheel --print-build-identifiers --platform macos --archs arm64 | jq -nRc '{"only": inputs, "os": "macos-15"}' \ + && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | jq -nRc '{"only": inputs, "os": "windows-2025"}' } | jq -sc ) echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT @@ -125,7 +131,7 @@ jobs: if: runner.os == 'Linux' uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - - uses: pypa/cibuildwheel@63fd63b352a9a8bdcc24791c9dbee952ee9a8abc # v3.3.0 + - uses: pypa/cibuildwheel@298ed2fb2c105540f5ed055e8a6ad78d82dd3a7e # v3.3.1 with: only: ${{ matrix.only }} env: From 1e7f0ec08d74826b41541a0c24b5e2865bf5d490 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Sun, 22 Feb 2026 23:01:10 +0100 Subject: [PATCH 2/6] Replace pkg_resources with packaging setuptools 82.0.0 removed pkg_resources, breaking the build. Use packaging.requirements.Requirement instead, and switch the Cython dependency string to PEP 508 format (no parentheses). --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 66a6fbe9..d93d4bff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ docs = [ requires = [ "setuptools>=77.0.3", "packaging>=24.0", - "Cython(>=3.2.1,<4.0.0)" + "Cython>=3.2.1,<4.0.0" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 76a5c40a..f93b8ca7 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ from setuptools.command import build_ext as setuptools_build_ext -CYTHON_DEPENDENCY = 'Cython(>=3.2.1,<4.0.0)' +CYTHON_DEPENDENCY = 'Cython>=3.2.1,<4.0.0' CFLAGS = ['-O2'] LDFLAGS = [] From ed447603b23b230f72715048d36ccf2800fa446e Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Sun, 22 Feb 2026 22:57:55 +0100 Subject: [PATCH 3/6] Various CI speedups - Switch to official PyPA build frontend for sdist ref https://pypi.org/project/build/ - Cancel running jobs when a new commit is pushed to a PR ref https://stackoverflow.com/questions/66335225#comment133398800_72408109 - Switch from setup-python to setup-uv ref https://github.com/astral-sh/setup-uv --- .github/workflows/release.yml | 4 ++-- .github/workflows/tests.yml | 30 +++++++++++------------------- 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f691290a..922ccbf1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,8 +63,8 @@ jobs: - name: Build source distribution run: | - pip install -U setuptools wheel pip - python setup.py sdist + pip install -U setuptools wheel build + python -m build --sdist - uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 896d1cb4..dafb7c46 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,6 +9,10 @@ on: branches: - master +concurrency: # https://stackoverflow.com/questions/66335225#comment133398800_72408109 + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: test-platforms: # NOTE: this matrix is for testing various combinations of Python and OS @@ -38,9 +42,6 @@ jobs: run: shell: bash - env: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - steps: - uses: actions/checkout@v5 with: @@ -66,21 +67,17 @@ jobs: echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" with: python-version: ${{ matrix.python-version }} - # Track the latest 3.15 build, including prereleases before GA. - allow-prereleases: ${{ startsWith(matrix.python-version, '3.15') }} - check-latest: ${{ startsWith(matrix.python-version, '3.15') }} + activate-environment: true - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh - python -m pip install -U pip setuptools wheel - python -m pip install --group test - python -m pip install -e . + uv pip install -e . --group test - name: Test if: "!steps.release.outputs.is_release" @@ -102,9 +99,6 @@ jobs: permissions: {} - env: - PIP_DISABLE_PIP_VERSION_CHECK: 1 - steps: - uses: actions/checkout@v5 with: @@ -133,19 +127,17 @@ jobs: echo PGINSTALLATION="/usr/lib/postgresql/${PGVERSION}/bin" \ >> "${GITHUB_ENV}" - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 + - name: Set up Python + uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" with: - python-version: "3.x" + activate-environment: true - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh - python -m pip install -U pip setuptools wheel - python -m pip install --group test - python -m pip install -e . + uv pip install -e . --group test - name: Test if: "!steps.release.outputs.is_release" From 90f685d998952a9517a5b62feeca7cbd83947dc9 Mon Sep 17 00:00:00 2001 From: ddelange <14880945+ddelange@users.noreply.github.com> Date: Mon, 23 Feb 2026 11:03:31 +0100 Subject: [PATCH 4/6] Pin runner images to avoid CI rot ref https://github.com/MagicStack/asyncpg/actions/runs/22286259051/job/64465189709?pr=1308 failed with: ====================================================================== ERROR: test_tls_version (test_connect.TestSSLConnection) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/work/asyncpg/asyncpg/asyncpg/_testbase/__init__.py", line 92, in wrapper self.loop.run_until_complete(coro) File "/Applications/Xcode_16.4.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/runner/work/asyncpg/asyncpg/tests/test_connect.py", line 2024, in test_tls_version await self.connect( File "/Users/runner/work/asyncpg/asyncpg/asyncpg/connection.py", line 2443, in connect return await connect_utils._connect( File "/Users/runner/work/asyncpg/asyncpg/asyncpg/connect_utils.py", line 1209, in _connect addrs, params, config = _parse_connect_arguments(**kwargs) File "/Users/runner/work/asyncpg/asyncpg/asyncpg/connect_utils.py", line 893, in _parse_connect_arguments addrs, params = _parse_connect_dsn_and_args( File "/Users/runner/work/asyncpg/asyncpg/asyncpg/connect_utils.py", line 798, in _parse_connect_dsn_and_args ssl.minimum_version = _parse_tls_version( File "/Applications/Xcode_16.4.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 586, in minimum_version super(SSLContext, SSLContext).minimum_version.__set__(self, value) ValueError: Unsupported protocol version 0x304 --- .github/workflows/release.yml | 12 ++++++------ .github/workflows/tests.yml | 34 +++++++++++++++++++--------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 922ccbf1..32554f32 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ on: jobs: validate-release-request: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Validate release PR uses: edgedb/action-release/validate-pr@master @@ -44,7 +44,7 @@ jobs: build-sdist: needs: validate-release-request - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: PIP_DISABLE_PIP_VERSION_CHECK: 1 @@ -73,7 +73,7 @@ jobs: build-wheels-matrix: needs: validate-release-request - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 outputs: include: ${{ steps.set-matrix.outputs.include }} steps: @@ -143,7 +143,7 @@ jobs: path: wheelhouse/*.whl merge-artifacts: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 needs: [build-sdist, build-wheels] steps: - name: Merge Artifacts @@ -154,7 +154,7 @@ jobs: publish-docs: needs: [build-sdist, build-wheels] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: PIP_DISABLE_PIP_VERSION_CHECK: 1 @@ -203,7 +203,7 @@ jobs: publish: needs: [build-sdist, build-wheels, publish-docs] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 environment: name: pypi diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dafb7c46..2df448d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -22,17 +22,20 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"] - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-24.04, macos-15, windows-2025] loop: [asyncio, uvloop] exclude: # uvloop does not support windows - loop: uvloop - os: windows-latest + os: windows-2025 # The test dependency group excludes uvloop on Python 3.15. - loop: uvloop python-version: "3.15" - loop: uvloop python-version: "3.15t" + # github does not provide 3.9 cpython for arm64 runners + - python-version: "3.9" + os: macos-15 runs-on: ${{ matrix.os }} @@ -59,13 +62,17 @@ jobs: version_line_pattern: | __version__(?:\s*:\s*typing\.Final)?\s*=\s*(?:['"])([[:PEP440:]])(?:['"]) - - name: Setup PostgreSQL - if: "!steps.release.outputs.is_release && matrix.os == 'macos-latest'" + - name: Set up PostgreSQL + if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'macos')" run: | POSTGRES_FORMULA="postgresql@18" brew install "$POSTGRES_FORMULA" echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH + - name: Set up Kerberos + if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'ubuntu')" + run: .github/workflows/install-krb5.sh + - name: Set up Python ${{ matrix.python-version }} uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" @@ -76,26 +83,20 @@ jobs: - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | - [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh uv pip install -e . --group test - name: Test if: "!steps.release.outputs.is_release" env: - LOOP_IMPL: ${{ matrix.loop }} - run: | - if [ "${LOOP_IMPL}" = "uvloop" ]; then - env USE_UVLOOP=1 python -m unittest -v tests.suite - else - python -m unittest -v tests.suite - fi + USE_UVLOOP: ${{ matrix.loop == 'uvloop' && '1' || '' }} + run: python -m unittest -v tests.suite test-postgres: strategy: matrix: postgres-version: ["9.5", "9.6", "10", "11", "12", "13", "14", "15", "16", "17", "18"] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: {} @@ -127,6 +128,10 @@ jobs: echo PGINSTALLATION="/usr/lib/postgresql/${PGVERSION}/bin" \ >> "${GITHUB_ENV}" + - name: Set up Kerberos + if: "!steps.release.outputs.is_release" + run: .github/workflows/install-krb5.sh + - name: Set up Python uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" @@ -136,7 +141,6 @@ jobs: - name: Install Python Deps if: "!steps.release.outputs.is_release" run: | - [ "$RUNNER_OS" = "Linux" ] && .github/workflows/install-krb5.sh uv pip install -e . --group test - name: Test @@ -151,7 +155,7 @@ jobs: regression-tests: name: "Regression Tests" needs: [test-platforms, test-postgres] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 permissions: {} steps: From 409b2146899b9adf49359600a18fa98b529952aa Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Mon, 28 Sep 2026 13:45:11 -0700 Subject: [PATCH 5/6] Preserve stable Python coverage in PostgreSQL CI --- .github/workflows/release.yml | 4 ++-- .github/workflows/tests.yml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32554f32..3d0b3829 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | jq -nRc '{"only": inputs, "os": "windows-2025"}' } | jq -sc ) - echo "include=$MATRIX_INCLUDE" >> $GITHUB_OUTPUT + echo "include=$MATRIX_INCLUDE" >> "$GITHUB_OUTPUT" build-wheels: needs: build-wheels-matrix @@ -230,7 +230,7 @@ jobs: id: relver run: | set -e - echo "version=$(cat dist/VERSION)" >> $GITHUB_OUTPUT + echo "version=$(cat dist/VERSION)" >> "$GITHUB_OUTPUT" rm dist/VERSION - name: Merge and tag the PR diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2df448d5..09b3b937 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,7 +67,7 @@ jobs: run: | POSTGRES_FORMULA="postgresql@18" brew install "$POSTGRES_FORMULA" - echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> $GITHUB_PATH + echo "$(brew --prefix "$POSTGRES_FORMULA")/bin" >> "$GITHUB_PATH" - name: Set up Kerberos if: "!steps.release.outputs.is_release && startsWith(matrix.os, 'ubuntu')" @@ -136,6 +136,7 @@ jobs: uses: astral-sh/setup-uv@v7 if: "!steps.release.outputs.is_release" with: + python-version: "3.14" activate-environment: true - name: Install Python Deps From 4bd02956e54c0128ff26cc4c2f159b65d1e6c1a6 Mon Sep 17 00:00:00 2001 From: Elvis Pranskevichus Date: Mon, 28 Sep 2026 13:46:50 -0700 Subject: [PATCH 6/6] Build Windows ARM64 wheels on native runner --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d0b3829..c934eaa1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -92,13 +92,15 @@ jobs: CIBW_SKIP: > pp* run: | + set -euo pipefail MATRIX_INCLUDE=$( { cibuildwheel --print-build-identifiers --platform linux --archs x86_64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04"}' \ && cibuildwheel --print-build-identifiers --platform linux --archs aarch64 | jq -nRc '{"only": inputs, "os": "ubuntu-24.04-arm"}' \ && cibuildwheel --print-build-identifiers --platform macos --archs x86_64 | jq -nRc '{"only": inputs, "os": "macos-15-intel"}' \ && cibuildwheel --print-build-identifiers --platform macos --archs arm64 | jq -nRc '{"only": inputs, "os": "macos-15"}' \ - && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | jq -nRc '{"only": inputs, "os": "windows-2025"}' + && cibuildwheel --print-build-identifiers --platform windows --archs x86,AMD64 | jq -nRc '{"only": inputs, "os": "windows-2025"}' \ + && cibuildwheel --print-build-identifiers --platform windows --archs ARM64 | jq -nRc '{"only": inputs, "os": "windows-11-arm"}' } | jq -sc ) echo "include=$MATRIX_INCLUDE" >> "$GITHUB_OUTPUT"