From 3eac19bd48e3351ce8a01fd4e92507176eb3f7a6 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Tue, 28 Apr 2026 09:26:59 +0200 Subject: [PATCH 1/3] Update zope.meta templates, support Windows/ARM64 and source dists --- .github/workflows/tests.yml | 131 +++++++++++++++++++++++------------- .meta.toml | 2 +- .pre-commit-config.yaml | 3 +- CHANGES.rst | 4 ++ tox.ini | 6 +- 5 files changed, 93 insertions(+), 53 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f5caa14..9b630cb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,10 +94,14 @@ jobs: - "3.12" - "3.13" - "3.14" - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "3.10" include: - python-version: "3.14t" os: ubuntu-latest @@ -131,27 +135,27 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: Install Build Dependencies run: | pip install -U pip - pip install -U "setuptools >= 78.1.1,< 81" wheel twine + pip install -U "setuptools >= 78.1.1,< 82" wheel twine - name: Build persistent (macOS x86_64) if: > @@ -189,10 +193,17 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel + - name: Create persistent sdist + if: > + startsWith(runner.os, 'Linux') + && matrix.python-version == '3.14' + run: | + python setup.py sdist + - name: Install persistent and dependencies run: | # Install to collect dependencies into the (pip) cache. - pip install -U pip "setuptools >= 78.1.1,< 81" + pip install -U pip "setuptools >= 78.1.1,< 82" pip install .[test] - name: Check persistent build @@ -202,7 +213,7 @@ jobs: - name: Upload persistent wheel (macOS x86_64) if: > startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: # The x86_64 wheel is uploaded with a different name just so it can be # manually downloaded when desired. The wheel itself *cannot* be tested @@ -213,18 +224,33 @@ jobs: if: > startsWith(runner.os, 'Mac') && !startsWith(matrix.python-version, 'pypy') - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*arm64.whl - - name: Upload persistent wheel (all other platforms) - if: > - !startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v4 + - name: Upload persistent wheel (Windows) + if: startsWith(runner.os, 'Windows') + uses: actions/upload-artifact@v7 + with: + name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl + path: dist/*whl + + - name: Upload persistent wheel (Linux) + if: startsWith(runner.os, 'Linux') + uses: actions/upload-artifact@v7 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*whl + - name: Upload persistent sdist + if: > + startsWith(runner.os, 'Linux') + && matrix.python-version == '3.14' + uses: actions/upload-artifact@v7 + with: + name: persistent-${{ github.ref_name }}.tar.gz + path: dist/*gz + test: needs: build-package runs-on: ${{ matrix.os }} @@ -238,10 +264,14 @@ jobs: - "3.12" - "3.13" - "3.14" - os: [ubuntu-latest, macos-latest, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "pypy-3.11" + - os: windows-11-arm + python-version: "3.10" include: - python-version: "3.14t" os: ubuntu-latest @@ -275,31 +305,38 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- - - - name: Download persistent wheel - uses: actions/download-artifact@v4 + ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Download persistent wheel (Linux/macOS) + if: "!startsWith(runner.os, 'Windows')" + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ + + - name: Download persistent wheel (Windows) + if: startsWith(runner.os, 'Windows') + uses: actions/download-artifact@v8 + with: + name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl + path: dist/ - name: Install persistent run: | - pip install -U wheel "setuptools >= 78.1.1,< 81" + pip install -U wheel "setuptools >= 78.1.1,< 82" pip install -U coverage[toml] pip install -U 'cffi; platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files @@ -375,25 +412,24 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- - + ${{ runner.os }}-${{ runner.arch }}-pip- - name: Download persistent wheel - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -446,25 +482,24 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ !startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-default.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 if: ${{ startsWith(runner.os, 'Windows') }} with: path: ${{ steps.pip-cache-windows.outputs.dir }} - key: ${{ runner.os }}-pip-${{ matrix.python-version }} + key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pip- - + ${{ runner.os }}-${{ runner.arch }}-pip- - name: Download persistent wheel - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -524,22 +559,22 @@ jobs: echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT - name: pip cache (default) - uses: actions/cache@v4 + uses: actions/cache@v5 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- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) - uses: actions/cache@v4 + uses: actions/cache@v5 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- + ${{ runner.os }}-${{ runner.arch }}-pip- - name: Update pip run: pip install -U pip @@ -562,7 +597,7 @@ jobs: bash .manylinux.sh - name: Upload persistent wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip @@ -586,7 +621,7 @@ jobs: steps: - name: Download all wheel artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: dist/ pattern: '*' diff --git a/.meta.toml b/.meta.toml index 89c34c2..33729b5 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code [meta] template = "c-code" -commit-id = "2dc4f53b" +commit-id = "f472bcc5" [python] with-windows = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c1e0027..59609e1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,7 +3,7 @@ minimum_pre_commit_version: '3.6' repos: - repo: https://github.com/pycqa/isort - rev: "7.0.0" + rev: "8.0.1" hooks: - id: isort - repo: https://github.com/hhatto/autopep8 @@ -20,6 +20,7 @@ repos: rev: 0.4.3 hooks: - id: teyit + language_version: python3.13 - repo: https://github.com/PyCQA/flake8 rev: "7.3.0" hooks: diff --git a/CHANGES.rst b/CHANGES.rst index f2efa48..61005d7 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,6 +4,10 @@ Change log 6.6 (unreleased) ---------------- +- Add support for automatically building and publishing Windows/ARM64 wheels. + +- Add support for automatically building and publishing source distributions. + - Fix compilation on free-threaded Python 3.14t: replace direct ``ob_refcnt``/``ob_type`` struct access with ``Py_REFCNT()``/``Py_TYPE()`` API macros, fix ``Py_BuildValue`` format strings for ``Py_ssize_t``. diff --git a/tox.ini b/tox.ini index 7490f9e..f4878c4 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ envlist = [testenv] deps = - setuptools >= 78.1.1,< 81 + setuptools >= 78.1.1,< 82 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 @@ -60,12 +60,12 @@ deps = twine build check-manifest - check-python-versions >= 0.20.0 + check-python-versions >= 0.24.2 wheel commands_pre = commands = check-manifest - check-python-versions --only pyproject.toml,setup.py,tox.ini + check-python-versions --only pyproject.toml,setup.py,tox.ini,.github/workflows/tests.yml python -m build --sdist --no-isolation twine check dist/* From 19f9676d579ff99879667be1388f0006deb1f283 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Wed, 29 Apr 2026 12:22:44 +0200 Subject: [PATCH 2/3] Fix GHA sdist artifact name --- .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 9b630cb..cfc8742 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -248,7 +248,7 @@ jobs: && matrix.python-version == '3.14' uses: actions/upload-artifact@v7 with: - name: persistent-${{ github.ref_name }}.tar.gz + name: persistent.tar.gz path: dist/*gz test: From 3cbb22ce99747795862bd020510be3f4a029ba52 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Fri, 1 May 2026 10:05:04 +0200 Subject: [PATCH 3/3] Apply meta#416 and meta#417 to fix test failures --- .github/workflows/tests.yml | 25 +++++-------------------- .meta.toml | 2 +- pyproject.toml | 4 ++++ setup.cfg | 4 ---- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cfc8742..2737e95 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -140,8 +140,6 @@ jobs: with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) uses: actions/cache@v5 @@ -149,8 +147,7 @@ jobs: with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Install Build Dependencies run: | @@ -310,8 +307,6 @@ jobs: with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) uses: actions/cache@v5 @@ -319,8 +314,7 @@ jobs: with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Download persistent wheel (Linux/macOS) if: "!startsWith(runner.os, 'Windows')" uses: actions/download-artifact@v8 @@ -417,8 +411,6 @@ jobs: with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) uses: actions/cache@v5 @@ -426,8 +418,7 @@ jobs: with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Download persistent wheel uses: actions/download-artifact@v8 with: @@ -487,8 +478,6 @@ jobs: with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) uses: actions/cache@v5 @@ -496,8 +485,7 @@ jobs: with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Download persistent wheel uses: actions/download-artifact@v8 with: @@ -564,8 +552,6 @@ jobs: with: path: ${{ steps.pip-cache-default.outputs.dir }} key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- - name: pip cache (Windows) uses: actions/cache@v5 @@ -573,8 +559,7 @@ jobs: with: path: ${{ steps.pip-cache-windows.outputs.dir }} key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }} - restore-keys: | - ${{ runner.os }}-${{ runner.arch }}-pip- + - name: Update pip run: pip install -U pip diff --git a/.meta.toml b/.meta.toml index 33729b5..4596477 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code [meta] template = "c-code" -commit-id = "f472bcc5" +commit-id = "2c0272ea" [python] with-windows = true diff --git a/pyproject.toml b/pyproject.toml index 130b5fc..3f212ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,3 +97,7 @@ source = [ [tool.setuptools.dynamic] readme = {file = ["README.rst", "CHANGES.rst"]} + +[tool.zest-releaser] +create-wheel = false +upload-pypi = false diff --git a/setup.cfg b/setup.cfg index 0555033..e5546af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,9 +1,5 @@ # Generated with zope.meta (https://zopemeta.readthedocs.io/) from: # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code - -[zest.releaser] -create-wheel = no - [flake8] doctests = 1