Skip to content

Commit baf42f1

Browse files
authored
Merge pull request #231 from zopefoundation/config-with-c-code-template-f472bcc5
Update zope.meta templates, support Windows/ARM64 and source dists
2 parents 83e1f57 + 3cbb22c commit baf42f1

7 files changed

Lines changed: 89 additions & 64 deletions

File tree

.github/workflows/tests.yml

Lines changed: 75 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ jobs:
9494
- "3.12"
9595
- "3.13"
9696
- "3.14"
97-
os: [ubuntu-latest, macos-latest, windows-latest]
97+
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm]
9898
exclude:
9999
- os: macos-latest
100100
python-version: "pypy-3.11"
101+
- os: windows-11-arm
102+
python-version: "pypy-3.11"
103+
- os: windows-11-arm
104+
python-version: "3.10"
101105
include:
102106
- python-version: "3.14t"
103107
os: ubuntu-latest
@@ -131,27 +135,24 @@ jobs:
131135
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
132136
133137
- name: pip cache (default)
134-
uses: actions/cache@v4
138+
uses: actions/cache@v5
135139
if: ${{ !startsWith(runner.os, 'Windows') }}
136140
with:
137141
path: ${{ steps.pip-cache-default.outputs.dir }}
138-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
139-
restore-keys: |
140-
${{ runner.os }}-pip-
142+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
141143

142144
- name: pip cache (Windows)
143-
uses: actions/cache@v4
145+
uses: actions/cache@v5
144146
if: ${{ startsWith(runner.os, 'Windows') }}
145147
with:
146148
path: ${{ steps.pip-cache-windows.outputs.dir }}
147-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
148-
restore-keys: |
149-
${{ runner.os }}-pip-
149+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
150+
150151

151152
- name: Install Build Dependencies
152153
run: |
153154
pip install -U pip
154-
pip install -U "setuptools >= 78.1.1,< 81" wheel twine
155+
pip install -U "setuptools >= 78.1.1,< 82" wheel twine
155156
156157
- name: Build persistent (macOS x86_64)
157158
if: >
@@ -189,10 +190,17 @@ jobs:
189190
python setup.py build_ext -i
190191
python setup.py bdist_wheel
191192
193+
- name: Create persistent sdist
194+
if: >
195+
startsWith(runner.os, 'Linux')
196+
&& matrix.python-version == '3.14'
197+
run: |
198+
python setup.py sdist
199+
192200
- name: Install persistent and dependencies
193201
run: |
194202
# Install to collect dependencies into the (pip) cache.
195-
pip install -U pip "setuptools >= 78.1.1,< 81"
203+
pip install -U pip "setuptools >= 78.1.1,< 82"
196204
pip install .[test]
197205
198206
- name: Check persistent build
@@ -202,7 +210,7 @@ jobs:
202210
- name: Upload persistent wheel (macOS x86_64)
203211
if: >
204212
startsWith(runner.os, 'Mac')
205-
uses: actions/upload-artifact@v4
213+
uses: actions/upload-artifact@v7
206214
with:
207215
# The x86_64 wheel is uploaded with a different name just so it can be
208216
# manually downloaded when desired. The wheel itself *cannot* be tested
@@ -213,18 +221,33 @@ jobs:
213221
if: >
214222
startsWith(runner.os, 'Mac')
215223
&& !startsWith(matrix.python-version, 'pypy')
216-
uses: actions/upload-artifact@v4
224+
uses: actions/upload-artifact@v7
217225
with:
218226
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
219227
path: dist/*arm64.whl
220-
- name: Upload persistent wheel (all other platforms)
221-
if: >
222-
!startsWith(runner.os, 'Mac')
223-
uses: actions/upload-artifact@v4
228+
- name: Upload persistent wheel (Windows)
229+
if: startsWith(runner.os, 'Windows')
230+
uses: actions/upload-artifact@v7
231+
with:
232+
name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl
233+
path: dist/*whl
234+
235+
- name: Upload persistent wheel (Linux)
236+
if: startsWith(runner.os, 'Linux')
237+
uses: actions/upload-artifact@v7
224238
with:
225239
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
226240
path: dist/*whl
227241

242+
- name: Upload persistent sdist
243+
if: >
244+
startsWith(runner.os, 'Linux')
245+
&& matrix.python-version == '3.14'
246+
uses: actions/upload-artifact@v7
247+
with:
248+
name: persistent.tar.gz
249+
path: dist/*gz
250+
228251
test:
229252
needs: build-package
230253
runs-on: ${{ matrix.os }}
@@ -238,10 +261,14 @@ jobs:
238261
- "3.12"
239262
- "3.13"
240263
- "3.14"
241-
os: [ubuntu-latest, macos-latest, windows-latest]
264+
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm]
242265
exclude:
243266
- os: macos-latest
244267
python-version: "pypy-3.11"
268+
- os: windows-11-arm
269+
python-version: "pypy-3.11"
270+
- os: windows-11-arm
271+
python-version: "3.10"
245272
include:
246273
- python-version: "3.14t"
247274
os: ubuntu-latest
@@ -275,31 +302,35 @@ jobs:
275302
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
276303
277304
- name: pip cache (default)
278-
uses: actions/cache@v4
305+
uses: actions/cache@v5
279306
if: ${{ !startsWith(runner.os, 'Windows') }}
280307
with:
281308
path: ${{ steps.pip-cache-default.outputs.dir }}
282-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
283-
restore-keys: |
284-
${{ runner.os }}-pip-
309+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
285310

286311
- name: pip cache (Windows)
287-
uses: actions/cache@v4
312+
uses: actions/cache@v5
288313
if: ${{ startsWith(runner.os, 'Windows') }}
289314
with:
290315
path: ${{ steps.pip-cache-windows.outputs.dir }}
291-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
292-
restore-keys: |
293-
${{ runner.os }}-pip-
316+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
294317

295-
- name: Download persistent wheel
296-
uses: actions/download-artifact@v4
318+
- name: Download persistent wheel (Linux/macOS)
319+
if: "!startsWith(runner.os, 'Windows')"
320+
uses: actions/download-artifact@v8
297321
with:
298322
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
299323
path: dist/
324+
325+
- name: Download persistent wheel (Windows)
326+
if: startsWith(runner.os, 'Windows')
327+
uses: actions/download-artifact@v8
328+
with:
329+
name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl
330+
path: dist/
300331
- name: Install persistent
301332
run: |
302-
pip install -U wheel "setuptools >= 78.1.1,< 81"
333+
pip install -U wheel "setuptools >= 78.1.1,< 82"
303334
pip install -U coverage[toml]
304335
pip install -U 'cffi; platform_python_implementation == "CPython"'
305336
# Unzip into src/ so that testrunner can find the .so files
@@ -375,25 +406,21 @@ jobs:
375406
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
376407
377408
- name: pip cache (default)
378-
uses: actions/cache@v4
409+
uses: actions/cache@v5
379410
if: ${{ !startsWith(runner.os, 'Windows') }}
380411
with:
381412
path: ${{ steps.pip-cache-default.outputs.dir }}
382-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
383-
restore-keys: |
384-
${{ runner.os }}-pip-
413+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
385414

386415
- name: pip cache (Windows)
387-
uses: actions/cache@v4
416+
uses: actions/cache@v5
388417
if: ${{ startsWith(runner.os, 'Windows') }}
389418
with:
390419
path: ${{ steps.pip-cache-windows.outputs.dir }}
391-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
392-
restore-keys: |
393-
${{ runner.os }}-pip-
420+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
394421

395422
- name: Download persistent wheel
396-
uses: actions/download-artifact@v4
423+
uses: actions/download-artifact@v8
397424
with:
398425
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
399426
path: dist/
@@ -446,25 +473,21 @@ jobs:
446473
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
447474
448475
- name: pip cache (default)
449-
uses: actions/cache@v4
476+
uses: actions/cache@v5
450477
if: ${{ !startsWith(runner.os, 'Windows') }}
451478
with:
452479
path: ${{ steps.pip-cache-default.outputs.dir }}
453-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
454-
restore-keys: |
455-
${{ runner.os }}-pip-
480+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
456481

457482
- name: pip cache (Windows)
458-
uses: actions/cache@v4
483+
uses: actions/cache@v5
459484
if: ${{ startsWith(runner.os, 'Windows') }}
460485
with:
461486
path: ${{ steps.pip-cache-windows.outputs.dir }}
462-
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
463-
restore-keys: |
464-
${{ runner.os }}-pip-
487+
key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }}
465488

466489
- name: Download persistent wheel
467-
uses: actions/download-artifact@v4
490+
uses: actions/download-artifact@v8
468491
with:
469492
name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl
470493
path: dist/
@@ -524,22 +547,19 @@ jobs:
524547
echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT
525548
526549
- name: pip cache (default)
527-
uses: actions/cache@v4
550+
uses: actions/cache@v5
528551
if: ${{ !startsWith(runner.os, 'Windows') }}
529552
with:
530553
path: ${{ steps.pip-cache-default.outputs.dir }}
531554
key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }}
532-
restore-keys: |
533-
${{ runner.os }}-pip-
534555

535556
- name: pip cache (Windows)
536-
uses: actions/cache@v4
557+
uses: actions/cache@v5
537558
if: ${{ startsWith(runner.os, 'Windows') }}
538559
with:
539560
path: ${{ steps.pip-cache-windows.outputs.dir }}
540561
key: ${{ runner.os }}-pip_manylinux-${{ matrix.image }}-${{ matrix.python-version }}
541-
restore-keys: |
542-
${{ runner.os }}-pip-
562+
543563

544564
- name: Update pip
545565
run: pip install -U pip
@@ -562,7 +582,7 @@ jobs:
562582
bash .manylinux.sh
563583
564584
- name: Upload persistent wheels
565-
uses: actions/upload-artifact@v4
585+
uses: actions/upload-artifact@v7
566586
with:
567587
path: wheelhouse/*whl
568588
name: manylinux_${{ matrix.image }}_wheels.zip
@@ -586,7 +606,7 @@ jobs:
586606

587607
steps:
588608
- name: Download all wheel artifacts
589-
uses: actions/download-artifact@v4
609+
uses: actions/download-artifact@v8
590610
with:
591611
path: dist/
592612
pattern: '*'

.meta.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "2dc4f53b"
5+
commit-id = "2c0272ea"
66

77
[python]
88
with-windows = true

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
minimum_pre_commit_version: '3.6'
44
repos:
55
- repo: https://github.com/pycqa/isort
6-
rev: "7.0.0"
6+
rev: "8.0.1"
77
hooks:
88
- id: isort
99
- repo: https://github.com/hhatto/autopep8
@@ -20,6 +20,7 @@ repos:
2020
rev: 0.4.3
2121
hooks:
2222
- id: teyit
23+
language_version: python3.13
2324
- repo: https://github.com/PyCQA/flake8
2425
rev: "7.3.0"
2526
hooks:

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Change log
44
6.6 (unreleased)
55
----------------
66

7+
- Add support for automatically building and publishing Windows/ARM64 wheels.
8+
9+
- Add support for automatically building and publishing source distributions.
10+
711
- Fix compilation on free-threaded Python 3.14t: replace direct
812
``ob_refcnt``/``ob_type`` struct access with ``Py_REFCNT()``/``Py_TYPE()``
913
API macros, fix ``Py_BuildValue`` format strings for ``Py_ssize_t``.

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,7 @@ source = [
9797

9898
[tool.setuptools.dynamic]
9999
readme = {file = ["README.rst", "CHANGES.rst"]}
100+
101+
[tool.zest-releaser]
102+
create-wheel = false
103+
upload-pypi = false

setup.cfg

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Generated with zope.meta (https://zopemeta.readthedocs.io/) from:
22
# https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code
3-
4-
[zest.releaser]
5-
create-wheel = no
6-
73
[flake8]
84
doctests = 1
95

tox.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ envlist =
1717

1818
[testenv]
1919
deps =
20-
setuptools >= 78.1.1,< 81
20+
setuptools >= 78.1.1,< 82
2121
setenv =
2222
pure: PURE_PYTHON=1
2323
!pure-!pypy3: PURE_PYTHON=0
@@ -60,12 +60,12 @@ deps =
6060
twine
6161
build
6262
check-manifest
63-
check-python-versions >= 0.20.0
63+
check-python-versions >= 0.24.2
6464
wheel
6565
commands_pre =
6666
commands =
6767
check-manifest
68-
check-python-versions --only pyproject.toml,setup.py,tox.ini
68+
check-python-versions --only pyproject.toml,setup.py,tox.ini,.github/workflows/tests.yml
6969
python -m build --sdist --no-isolation
7070
twine check dist/*
7171

0 commit comments

Comments
 (0)