From 97241dad72bffe3758a13e51647ec12df24b0330 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Thu, 30 Oct 2025 17:13:29 +0100 Subject: [PATCH 01/10] - try to build manylinux wheels for arm64 without emulation --- .editorconfig | 2 +- .github/workflows/tests.yml | 85 ++++++++++++++++++++++++++++++++++--- .meta.toml | 2 +- 3 files changed, 82 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9d3c4f2..5094013 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code # # EditorConfig Configuration file, for more details see: -# http://EditorConfig.org +# https://EditorConfig.org # EditorConfig is a convention description, that could be interpreted # by multiple editors to enforce common coding conventions for specific # file types diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b4ef82..4b44b5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -452,14 +452,14 @@ jobs: run: | tox -e release-check - manylinux: + manylinux-x86: runs-on: ubuntu-latest if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name # We use a regular Python matrix entry to share as much code as possible. strategy: matrix: python-version: ["3.11"] - image: [manylinux2014_x86_64, manylinux2014_i686, manylinux2014_aarch64] + image: [manylinux2014_x86_64, manylinux2014_i686] steps: - name: checkout @@ -525,13 +525,88 @@ jobs: PRE_CMD: linux32 run: | bash .manylinux.sh + + - name: Upload ExtensionClass wheels + uses: actions/upload-artifact@v4 + with: + path: wheelhouse/*whl + name: manylinux_${{ matrix.image }}_wheels.zip + - name: Restore pip cache permissions + run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} + - name: Prevent publishing wheels for unreleased Python versions + run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + if: > + github.event_name == 'push' + && startsWith(github.ref, 'refs/tags') + with: + user: __token__ + password: ${{ secrets.TWINE_PASSWORD }} + skip-existing: true + packages-dir: wheelhouse/ + + manylinux-arm64: + runs-on: ubuntu-24.04-arm + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + # We use a regular Python matrix entry to share as much code as possible. + strategy: + matrix: + python-version: ["3.11"] + image: [manylinux2014_aarch64] + + steps: + - name: checkout + uses: actions/checkout@v5 + with: + persist-credentials: false + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + ### + # Caching. + # This actually *restores* a cache and schedules a cleanup action + # to save the cache. So it must come before the thing we want to use + # the cache. + ### + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT + + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + if: ${{ !startsWith(runner.os, 'Windows') }} + with: + path: ${{ steps.pip-cache-default.outputs.dir }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: pip cache (Windows) + uses: actions/cache@v4 + if: ${{ startsWith(runner.os, 'Windows') }} + with: + path: ${{ steps.pip-cache-windows.outputs.dir }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} + restore-keys: | + ${{ runner.os }}-pip- + + - name: Update pip + run: pip install -U pip - name: Build ExtensionClass (aarch64) - if: matrix.image == 'manylinux2014_aarch64' env: DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }} run: | - # First we must enable emulation - docker run --rm --privileged hypriot/qemu-register bash .manylinux.sh - name: Upload ExtensionClass wheels diff --git a/.meta.toml b/.meta.toml index 01993f1..3896161 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "d4b7f3ba" +commit-id = "df7040c5" [python] with-windows = true From bce397c4ffa8957e46b624f621f7c75c99185eff Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 11:24:21 +0100 Subject: [PATCH 02/10] - update Python version used for manylinux builds --- .github/workflows/tests.yml | 6 +++--- .meta.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4b44b5d..ac2b5e6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -387,7 +387,7 @@ jobs: runs-on: "ubuntu-latest" strategy: matrix: - python-version: ["3.11"] + python-version: ["3.13"] os: [ubuntu-latest] steps: @@ -458,7 +458,7 @@ jobs: # We use a regular Python matrix entry to share as much code as possible. strategy: matrix: - python-version: ["3.11"] + python-version: ["3.13"] image: [manylinux2014_x86_64, manylinux2014_i686] steps: @@ -552,7 +552,7 @@ jobs: # We use a regular Python matrix entry to share as much code as possible. strategy: matrix: - python-version: ["3.11"] + python-version: ["3.13"] image: [manylinux2014_aarch64] steps: diff --git a/.meta.toml b/.meta.toml index 3896161..5042f92 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "df7040c5" +commit-id = "84826126" [python] with-windows = true From b14339b6bffda5b37ae0a998f8e8abc96fd99b6e Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 11:33:05 +0100 Subject: [PATCH 03/10] - use Python 3.13 for pre-commit step, teyit fails on 3.14 --- .github/workflows/pre-commit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index eaf3a78..8f2ad3c 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v5 - uses: actions/setup-python@v6 with: - python-version: 3.x + python-version: '3.13' - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd #v3.0.1 with: extra_args: --all-files --show-diff-on-failure From f577fd50ffebd1397089e6c11374d8f981ec9d3f Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:08:28 +0100 Subject: [PATCH 04/10] - try to simplify manylinux step with a matrix --- .github/workflows/tests.yml | 109 ++++++------------------------------ .meta.toml | 2 +- 2 files changed, 18 insertions(+), 93 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac2b5e6..d1fbccf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -452,15 +452,19 @@ jobs: run: | tox -e release-check - manylinux-x86: - runs-on: ubuntu-latest + manylinux: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name - # We use a regular Python matrix entry to share as much code as possible. + # We use a matrix to share as much code as possible. strategy: matrix: - python-version: ["3.13"] - image: [manylinux2014_x86_64, manylinux2014_i686] - + include: + - os: ubuntu-latest + image: manylinux2014_x86_64 + - os: ubuntu-latest + image: manylinux2014_i686 + - os: ubuntu-24.04-arm + image: manylinux2014_aarch64 + runs-on: {{ matrix.os }} steps: - name: checkout uses: actions/checkout@v5 @@ -494,7 +498,7 @@ jobs: if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ %(manylinux_python_version)s }} restore-keys: | ${{ runner.os }}-pip- @@ -503,14 +507,15 @@ jobs: if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ %(manylinux_python_version)s }} restore-keys: | ${{ runner.os }}-pip- - name: Update pip run: pip install -U pip - - name: Build ExtensionClass (x86_64) - if: matrix.image == 'manylinux2014_x86_64' + + - name: Build ExtensionClass + if: matrix.image != 'manylinux2014_i686' # An alternate way to do this is to run the container directly with a uses: # and then the script runs inside it. That may work better with caching. # See https://github.com/pyca/bcrypt/blob/f6b5ee2eda76d077c531362ac65e16f045cf1f29/.github/workflows/wheel-builder.yml @@ -531,93 +536,13 @@ jobs: with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip - - name: Restore pip cache permissions - run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} - - name: Prevent publishing wheels for unreleased Python versions - run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse - - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - if: > - github.event_name == 'push' - && startsWith(github.ref, 'refs/tags') - with: - user: __token__ - password: ${{ secrets.TWINE_PASSWORD }} - skip-existing: true - packages-dir: wheelhouse/ - manylinux-arm64: - runs-on: ubuntu-24.04-arm - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name - # We use a regular Python matrix entry to share as much code as possible. - strategy: - matrix: - python-version: ["3.13"] - image: [manylinux2014_aarch64] - - steps: - - name: checkout - uses: actions/checkout@v5 - with: - persist-credentials: false - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - ### - # Caching. - # This actually *restores* a cache and schedules a cleanup action - # to save the cache. So it must come before the thing we want to use - # the cache. - ### - - name: Get pip cache dir (default) - id: pip-cache-default - if: ${{ !startsWith(runner.os, 'Windows') }} - run: | - echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - - name: Get pip cache dir (Windows) - id: pip-cache-windows - if: ${{ startsWith(runner.os, 'Windows') }} - run: | - echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - - - name: pip cache (default) - uses: actions/cache@v4 - if: ${{ !startsWith(runner.os, 'Windows') }} - with: - path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: pip cache (Windows) - uses: actions/cache@v4 - if: ${{ startsWith(runner.os, 'Windows') }} - with: - path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Update pip - run: pip install -U pip - - name: Build ExtensionClass (aarch64) - env: - DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }} - run: | - bash .manylinux.sh - - - name: Upload ExtensionClass wheels - uses: actions/upload-artifact@v4 - with: - path: wheelhouse/*whl - name: manylinux_${{ matrix.image }}_wheels.zip - name: Restore pip cache permissions run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} + - name: Prevent publishing wheels for unreleased Python versions run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > diff --git a/.meta.toml b/.meta.toml index 5042f92..db90fd5 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "84826126" +commit-id = "4d8aead5" [python] with-windows = true From c508270e6ec121961c61294a359760097ab86a82 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:20:46 +0100 Subject: [PATCH 05/10] - fix template output --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d1fbccf..ea6fff4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -454,9 +454,11 @@ jobs: manylinux: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name + runs-on: {{ matrix.os }} # We use a matrix to share as much code as possible. strategy: matrix: + python-version: ["3.13"] include: - os: ubuntu-latest image: manylinux2014_x86_64 @@ -464,7 +466,6 @@ jobs: image: manylinux2014_i686 - os: ubuntu-24.04-arm image: manylinux2014_aarch64 - runs-on: {{ matrix.os }} steps: - name: checkout uses: actions/checkout@v5 @@ -498,7 +499,7 @@ jobs: if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ %(manylinux_python_version)s }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} restore-keys: | ${{ runner.os }}-pip- @@ -507,7 +508,7 @@ jobs: if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ %(manylinux_python_version)s }} + key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} restore-keys: | ${{ runner.os }}-pip- From d19728d836611a446edacb390b0df59140afb4b3 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:23:41 +0100 Subject: [PATCH 06/10] - try to fix template output --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea6fff4..bb579a7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -453,8 +453,8 @@ jobs: tox -e release-check manylinux: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: {{ matrix.os }} + if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name # We use a matrix to share as much code as possible. strategy: matrix: From ed50a7dee29110bcc9bc4e8356e62240a85162b5 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:41:06 +0100 Subject: [PATCH 07/10] - try to fix template output --- .github/workflows/tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bb579a7..5bb7848 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -458,14 +458,16 @@ jobs: # We use a matrix to share as much code as possible. strategy: matrix: - python-version: ["3.13"] include: - os: ubuntu-latest image: manylinux2014_x86_64 + python-version: "3.13" - os: ubuntu-latest image: manylinux2014_i686 + python-version: "3.13" - os: ubuntu-24.04-arm image: manylinux2014_aarch64 + python-version: "3.13" steps: - name: checkout uses: actions/checkout@v5 @@ -514,7 +516,6 @@ jobs: - name: Update pip run: pip install -U pip - - name: Build ExtensionClass if: matrix.image != 'manylinux2014_i686' # An alternate way to do this is to run the container directly with a uses: @@ -537,13 +538,10 @@ jobs: with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip - - name: Restore pip cache permissions run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} - - name: Prevent publishing wheels for unreleased Python versions run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse - - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > From b844e6207a73007553e55a97706a7414837b69b7 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:44:01 +0100 Subject: [PATCH 08/10] - add missing $ --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5bb7848..96af1fd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -453,7 +453,7 @@ jobs: tox -e release-check manylinux: - runs-on: {{ matrix.os }} + runs-on: ${{ matrix.os }} if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name # We use a matrix to share as much code as possible. strategy: From c224830808cb5144fdf24ca20862f96fffb0db7c Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:46:35 +0100 Subject: [PATCH 09/10] - tweak matrix, readability --- .github/workflows/tests.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 96af1fd..78e3436 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -458,16 +458,14 @@ jobs: # We use a matrix to share as much code as possible. strategy: matrix: + python-version: ["3.13"] include: - os: ubuntu-latest image: manylinux2014_x86_64 - python-version: "3.13" - os: ubuntu-latest image: manylinux2014_i686 - python-version: "3.13" - os: ubuntu-24.04-arm image: manylinux2014_aarch64 - python-version: "3.13" steps: - name: checkout uses: actions/checkout@v5 @@ -516,6 +514,7 @@ jobs: - name: Update pip run: pip install -U pip + - name: Build ExtensionClass if: matrix.image != 'manylinux2014_i686' # An alternate way to do this is to run the container directly with a uses: @@ -538,10 +537,13 @@ jobs: with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip + - name: Restore pip cache permissions run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} + - name: Prevent publishing wheels for unreleased Python versions run: VER=$(echo '3.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse + - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > From f0eb4febb5346bd71ffd1644a3e2d83709986a86 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 31 Oct 2025 12:48:41 +0100 Subject: [PATCH 10/10] - pulling a common matrix element to the top does not work --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 78e3436..4e110a0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -458,14 +458,16 @@ jobs: # We use a matrix to share as much code as possible. strategy: matrix: - python-version: ["3.13"] include: - os: ubuntu-latest image: manylinux2014_x86_64 + python-version: "3.13" - os: ubuntu-latest image: manylinux2014_i686 + python-version: "3.13" - os: ubuntu-24.04-arm image: manylinux2014_aarch64 + python-version: "3.13" steps: - name: checkout uses: actions/checkout@v5