-
Notifications
You must be signed in to change notification settings - Fork 0
259 lines (251 loc) · 9.88 KB
/
Copy pathwheels.yml
File metadata and controls
259 lines (251 loc) · 9.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
name: Wheels
on:
workflow_dispatch:
push:
tags: ["v*"]
# A change to how a wheel is built is exercised on the pull request
# that makes it. The alternative is finding out on the tag, which is
# the one moment a wheel cannot be rebuilt quietly.
pull_request:
paths:
- .github/workflows/wheels.yml
- Cargo.toml
- pyproject.toml
- rust-toolchain.toml
- tools/wheel_tags.py
- tools/reference.py
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
# Three wheels per platform, and the reason is CPython's rather than
# ours: the free-threaded build had no stable ABI until 3.15 and PEP
# 803's `abi3t`, so 3.14t is a version-specific wheel of its own and
# will be for as long as 3.14 is supported.
wheel:
name: ${{ matrix.abi }} ${{ matrix.platform }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
abi: [abi3, ft314, abi3t]
platform:
- manylinux_2_28_x86_64
- manylinux_2_28_aarch64
- musllinux_1_2_x86_64
- musllinux_1_2_aarch64
- macosx_universal2
- win_amd64
- win_arm64
include:
# Which ABI, which is a Cargo feature and an interpreter.
# `abi3` is the default feature, so the first row asks for
# nothing; the other two turn it off, because a wheel built
# against the stable ABI cannot also be built against one
# version's. `inside` is the same interpreter as `version` for
# the rows that build in a container, where the runner's
# Python is not visible and the image's own `python3` is
# whatever the image happens to ship.
- abi: abi3
tag: cp311-abi3
features: ""
version: "3.11"
freethreaded: false
inside: /opt/python/cp311-cp311/bin/python
- abi: ft314
tag: cp314-cp314t
features: "--no-default-features"
version: "3.14"
freethreaded: true
inside: /opt/python/cp314-cp314t/bin/python
- abi: abi3t
tag: cp315-abi3.abi3t
features: "--no-default-features --features abi3t"
version: "3.15-dev"
freethreaded: true
inside: /opt/python/cp315-cp315t/bin/python
# Which platform, which is a runner and a target. Every row
# is built on its own architecture: an emulated build takes
# twenty minutes to produce the same bytes. The Linux rows
# name their image rather than taking the default, because
# the default for musl is a cross image that carries four
# GIL-enabled interpreters and no free-threaded one, and the
# pypa images are the ones that carry every interpreter this
# matrix asks for under /opt/python.
- platform: manylinux_2_28_x86_64
runner: ubuntu-latest
target: x86_64
libc: "2_28"
image: quay.io/pypa/manylinux_2_28_x86_64
installable: true
- platform: manylinux_2_28_aarch64
runner: ubuntu-24.04-arm
target: aarch64
libc: "2_28"
image: quay.io/pypa/manylinux_2_28_aarch64
installable: true
- platform: musllinux_1_2_x86_64
runner: ubuntu-latest
target: x86_64
libc: musllinux_1_2
image: quay.io/pypa/musllinux_1_2_x86_64
installable: false
- platform: musllinux_1_2_aarch64
runner: ubuntu-24.04-arm
target: aarch64
libc: musllinux_1_2
image: quay.io/pypa/musllinux_1_2_aarch64
installable: false
- platform: macosx_universal2
runner: macos-latest
target: universal2-apple-darwin
libc: auto
image: ""
installable: true
- platform: win_amd64
runner: windows-latest
target: x64
libc: auto
image: ""
installable: true
- platform: win_arm64
runner: windows-11-arm
target: aarch64-pc-windows-msvc
libc: auto
image: ""
installable: true
steps:
- uses: actions/checkout@v7
# The interpreter maturin names the wheel after on macOS and
# Windows, and the one that installs it below everywhere it can
# be installed. The Linux rows build inside the manylinux and
# musllinux images, which carry their own.
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.version }}
freethreaded: ${{ matrix.freethreaded }}
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: ${{ matrix.libc }}
container: ${{ matrix.image || 'auto' }}
# Named rather than left to the toolchain file, which the
# build container does not read.
rust-toolchain: 1.98.0
# The interpreter, named, on the rows that build in a
# container. Left to the path everywhere else, where
# setup-python above put the row's interpreter first. An
# unnamed interpreter is how the first run of this workflow
# built four Linux wheels for the image's own Python 3.12.
args: >-
--release --out dist ${{ matrix.features }}
${{ matrix.image != '' && format('-i {0}', matrix.inside) || '' }}
# Which interpreters the image carries, which is the first
# thing worth reading when a row builds the wrong wheel, and
# then the one this row asked for, so that a missing
# interpreter fails here rather than further down. The
# extension is a shared object and a static C runtime cannot
# be linked into one, which is the musl default and a no-op
# everywhere else.
before-script-linux: |
ls -1 /opt/python
test -x ${{ matrix.inside }}
export RUSTFLAGS="-C target-feature=-crt-static"
# The wheel is named by the interpreter that built it and by
# nothing that was checked, so this checks it: the tag has to be
# the one this row asked for. A build that fell back to a
# version-specific wheel produces a wheel that works and claims
# nothing about any version but its own.
- run: python tools/wheel_tags.py dist ${{ matrix.tag }} ${{ matrix.platform }}
- name: the wheel imports
if: matrix.installable
run: |
python -m pip install --no-index --find-links dist zudb
python -c "import zudb; print(zudb.__version__, zudb.__abi_version__)"
- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.abi }}-${{ matrix.platform }}
path: dist/*.whl
# Every platform with no row above, and the one everybody who
# packages this for something else starts from. Built once, from the
# same checkout, and tested by building it back into a wheel.
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: pip install --no-binary zudb dist/*.tar.gz
- run: python -c "import zudb; print(zudb.__version__)"
- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz
# The reference, built from the wheel this release is publishing and
# not from the checkout it came out of. Half of this package is
# compiled, so a reference generated from source would be a reference
# of the half a reader can read already, and the interesting half
# exists only once it is built.
#
# One wheel is enough and it is the stable-ABI Linux one, because
# what is being read is the public surface and every wheel in the
# grid has the same one. A grid of fourteen references would be
# fourteen copies of one page and thirteen chances for a reader to
# find the wrong one.
reference:
needs: wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- uses: actions/download-artifact@v4
with:
name: wheel-abi3-manylinux_2_28_x86_64
path: dist
- run: pip install --no-index --find-links dist zudb
# ipython because `zudb.magic` imports it at the top and a module
# that cannot be imported cannot be documented, and it is the
# `%%gql` half of this client rather than an extra.
- run: pip install pdoc==16.0.0 ipython
- run: python tools/reference.py reference
- uses: actions/upload-artifact@v4
with:
name: reference
path: reference/
if-no-files-found: error
# The grid, checked as a grid. Every cell filled and nothing outside
# it, which is the check a single row cannot do.
tags:
needs: [wheel, sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# By name rather than everything this run produced, because the
# check is that the directory holds the grid and nothing else,
# and the reference job puts a directory of HTML in the same run.
# A rule that says "nothing outside the grid" reads whatever it
# is handed, so what it is handed has to be the grid.
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- uses: actions/setup-python@v6
with:
python-version: "3.14"
- run: python tools/wheel_tags.py dist