Skip to content

Commit 512d86b

Browse files
authored
ci: Build abi3 wheels where possible (#123)
1 parent b9d802e commit 512d86b

File tree

2 files changed

+51
-12
lines changed

2 files changed

+51
-12
lines changed

.github/workflows/python-wheels.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,24 @@ jobs:
5454
version: "0.5.x"
5555

5656
- name: Install Python versions
57-
run: uv python install 3.9 3.10 3.11 3.12 3.13 pypy3.10
57+
run: uv python install 3.10 3.13 pypy3.10
5858

59-
- name: Build wheels
59+
- name: Build abi3-py311 wheels
6060
uses: PyO3/maturin-action@v1
6161
with:
6262
target: ${{ matrix.platform.target }}
63-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i pypy3.10 --manifest-path python/Cargo.toml
63+
args: --release --out dist -i 3.13 --features abi3-py311 --features extension-module --manifest-path python/Cargo.toml
6464
sccache: "true"
6565
manylinux: ${{ matrix.platform.manylinux }}
66+
67+
- name: Build version-specific wheels
68+
uses: PyO3/maturin-action@v1
69+
with:
70+
target: ${{ matrix.platform.target }}
71+
args: --release --out dist -i 3.10 -i pypy3.10 --features extension-module --manifest-path python/Cargo.toml
72+
sccache: "true"
73+
manylinux: ${{ matrix.platform.manylinux }}
74+
6675
- name: Upload wheels
6776
uses: actions/upload-artifact@v4
6877
with:
@@ -94,15 +103,24 @@ jobs:
94103
version: "0.5.x"
95104

96105
- name: Install Python versions
97-
run: uv python install 3.9 3.10 3.11 3.12 3.13 pypy3.10
106+
run: uv python install 3.10 3.13 pypy3.10
98107

99-
- name: Build wheels
108+
- name: Build abi3-py311 wheels
100109
uses: PyO3/maturin-action@v1
101110
with:
102111
target: ${{ matrix.platform.target }}
103-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i pypy3.10 --manifest-path python/Cargo.toml
112+
args: --release --out dist -i 3.13 --features abi3-py311 --features extension-module --manifest-path python/Cargo.toml
104113
sccache: "true"
105114
manylinux: musllinux_1_2
115+
116+
- name: Build version-specific wheels
117+
uses: PyO3/maturin-action@v1
118+
with:
119+
target: ${{ matrix.platform.target }}
120+
args: --release --out dist -i 3.10 -i pypy3.10 --features extension-module --manifest-path python/Cargo.toml
121+
sccache: "true"
122+
manylinux: musllinux_1_2
123+
106124
- name: Upload wheels
107125
uses: actions/upload-artifact@v4
108126
with:
@@ -131,12 +149,21 @@ jobs:
131149
- name: Remove symlink (not supported in Windows wheels)
132150
run: Remove-Item -Path python/python/async_tiff/store -Force
133151
shell: pwsh
134-
- name: Build wheels
152+
153+
- name: Build abi3-py311 wheels
135154
uses: PyO3/maturin-action@v1
136155
with:
137156
target: ${{ matrix.platform.target }}
138-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/Cargo.toml
157+
args: --release --out dist -i 3.13 --features abi3-py311 --features extension-module --manifest-path python/Cargo.toml
139158
sccache: "true"
159+
160+
- name: Build version-specific wheels
161+
uses: PyO3/maturin-action@v1
162+
with:
163+
target: ${{ matrix.platform.target }}
164+
args: --release --out dist -i 3.10 --features extension-module --manifest-path python/Cargo.toml
165+
sccache: "true"
166+
140167
- name: Upload wheels
141168
uses: actions/upload-artifact@v4
142169
with:
@@ -164,14 +191,22 @@ jobs:
164191
version: "0.5.x"
165192

166193
- name: Install Python versions
167-
run: uv python install 3.9 3.10 3.11 3.12 3.13 pypy3.10
194+
run: uv python install 3.10 3.13 pypy3.10
168195

169-
- name: Build wheels
196+
- name: Build abi3-py311 wheels
170197
uses: PyO3/maturin-action@v1
171198
with:
172199
target: ${{ matrix.platform.target }}
173-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i pypy3.10 --manifest-path python/Cargo.toml
200+
args: --release --out dist -i 3.13 --features abi3-py311 --features extension-module --manifest-path python/Cargo.toml
174201
sccache: "true"
202+
203+
- name: Build version-specific wheels
204+
uses: PyO3/maturin-action@v1
205+
with:
206+
target: ${{ matrix.platform.target }}
207+
args: --release --out dist -i 3.10 -i pypy3.10 --features extension-module --manifest-path python/Cargo.toml
208+
sccache: "true"
209+
175210
- name: Upload wheels
176211
uses: actions/upload-artifact@v4
177212
with:
@@ -205,7 +240,7 @@ jobs:
205240
# # IMPORTANT: this permission is mandatory for trusted publishing
206241
# id-token: write
207242
if: startsWith(github.ref, 'refs/tags/')
208-
needs: [linux, musllinux, macos]
243+
needs: [linux, musllinux, windows, macos]
209244
steps:
210245
- uses: actions/download-artifact@v4
211246
with:

python/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ rust-version = "1.75"
1616
name = "_async_tiff"
1717
crate-type = ["cdylib"]
1818

19+
[features]
20+
abi3-py311 = ["pyo3/abi3-py311"]
21+
extension-module = ["pyo3/extension-module"]
22+
1923
[dependencies]
2024
async-tiff = { path = "../" }
2125
bytes = "1.10.1"

0 commit comments

Comments
 (0)