Skip to content

Commit 7b7b385

Browse files
Upgrade PyO3 and remove no longer supported platforms (#30)
* upgrade deps * update python version * upgrade deps * fix compat issue with latest pyo3 * remove no longer supported platforms * bump version * update github workflows
1 parent ec5e0a8 commit 7b7b385

File tree

4 files changed

+172
-194
lines changed

4 files changed

+172
-194
lines changed

.github/workflows/CI.yml

Lines changed: 133 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v1.4.0
1+
# This file is autogenerated by maturin v1.7.8
22
# To update, run
33
#
44
# maturin generate-ci github --pytest -o .github/workflows/CI.yml
@@ -20,40 +20,54 @@ permissions:
2020

2121
jobs:
2222
linux:
23-
runs-on: ubuntu-latest
23+
runs-on: ${{ matrix.platform.runner }}
2424
strategy:
2525
matrix:
26-
target: [x86_64, x86, aarch64, armv7, s390x, ppc64le]
26+
platform:
27+
- runner: ubuntu-22.04
28+
target: x86_64
29+
- runner: ubuntu-22.04
30+
target: x86
31+
- runner: ubuntu-22.04
32+
target: aarch64
33+
- runner: ubuntu-22.04
34+
target: armv7
35+
- runner: ubuntu-22.04
36+
target: s390x
37+
- runner: ubuntu-22.04
38+
target: ppc64le
2739
steps:
2840
- uses: actions/checkout@v4
2941
- uses: actions/setup-python@v5
3042
with:
31-
python-version: '3.10'
43+
python-version: 3.x
3244
- name: Build wheels
3345
uses: PyO3/maturin-action@v1
3446
with:
35-
target: ${{ matrix.target }}
47+
target: ${{ matrix.platform.target }}
3648
args: --release --out dist --find-interpreter
3749
sccache: 'true'
3850
manylinux: auto
3951
- name: Upload wheels
40-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
4153
with:
42-
name: wheels
54+
name: wheels-linux-${{ matrix.platform.target }}
4355
path: dist
4456
- name: pytest
45-
if: ${{ startsWith(matrix.target, 'x86_64') }}
57+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
4658
shell: bash
4759
run: |
4860
set -e
49-
pip install pycrc32 --find-links dist --force-reinstall --no-index
61+
python3 -m venv .venv
62+
source .venv/bin/activate
63+
pip install pycrc32 --find-links dist --force-reinstall
5064
pip install pytest
5165
pytest
5266
- name: pytest
53-
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }}
54-
uses: uraimo/run-on-arch-action@v2.7.1
67+
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
68+
uses: uraimo/run-on-arch-action@v2
5569
with:
56-
arch: ${{ matrix.target }}
70+
arch: ${{ matrix.platform.target }}
5771
distro: ubuntu22.04
5872
githubToken: ${{ github.token }}
5973
install: |
@@ -62,67 +76,138 @@ jobs:
6276
pip3 install -U pip pytest
6377
run: |
6478
set -e
65-
pip3 install pycrc32 --find-links dist --force-reinstall --no-index
79+
pip3 install pycrc32 --find-links dist --force-reinstall
80+
pytest
81+
82+
musllinux:
83+
runs-on: ${{ matrix.platform.runner }}
84+
strategy:
85+
matrix:
86+
platform:
87+
- runner: ubuntu-22.04
88+
target: x86_64
89+
- runner: ubuntu-22.04
90+
target: x86
91+
- runner: ubuntu-22.04
92+
target: aarch64
93+
- runner: ubuntu-22.04
94+
target: armv7
95+
steps:
96+
- uses: actions/checkout@v4
97+
- uses: actions/setup-python@v5
98+
with:
99+
python-version: 3.x
100+
- name: Build wheels
101+
uses: PyO3/maturin-action@v1
102+
with:
103+
target: ${{ matrix.platform.target }}
104+
args: --release --out dist --find-interpreter
105+
sccache: 'true'
106+
manylinux: musllinux_1_2
107+
- name: Upload wheels
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: wheels-musllinux-${{ matrix.platform.target }}
111+
path: dist
112+
- name: pytest
113+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
114+
uses: addnab/docker-run-action@v3
115+
with:
116+
image: alpine:latest
117+
options: -v ${{ github.workspace }}:/io -w /io
118+
run: |
119+
set -e
120+
apk add py3-pip py3-virtualenv
121+
python3 -m virtualenv .venv
122+
source .venv/bin/activate
123+
pip install pycrc32 --no-index --find-links dist --force-reinstall
124+
pip install pytest
125+
pytest
126+
- name: pytest
127+
if: ${{ !startsWith(matrix.platform.target, 'x86') }}
128+
uses: uraimo/run-on-arch-action@v2
129+
with:
130+
arch: ${{ matrix.platform.target }}
131+
distro: alpine_latest
132+
githubToken: ${{ github.token }}
133+
install: |
134+
apk add py3-virtualenv
135+
run: |
136+
set -e
137+
python3 -m virtualenv .venv
138+
source .venv/bin/activate
139+
pip install pytest
140+
pip install pycrc32 --find-links dist --force-reinstall
66141
pytest
67142
68143
windows:
69-
runs-on: windows-latest
144+
runs-on: ${{ matrix.platform.runner }}
70145
strategy:
71146
matrix:
72-
target: [x64, x86]
147+
platform:
148+
- runner: windows-latest
149+
target: x64
150+
- runner: windows-latest
151+
target: x86
73152
steps:
74153
- uses: actions/checkout@v4
75154
- uses: actions/setup-python@v5
76155
with:
77-
python-version: '3.10'
78-
architecture: ${{ matrix.target }}
156+
python-version: 3.x
157+
architecture: ${{ matrix.platform.target }}
79158
- name: Build wheels
80159
uses: PyO3/maturin-action@v1
81160
with:
82-
target: ${{ matrix.target }}
161+
target: ${{ matrix.platform.target }}
83162
args: --release --out dist --find-interpreter
84163
sccache: 'true'
85164
- name: Upload wheels
86-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@v4
87166
with:
88-
name: wheels
167+
name: wheels-windows-${{ matrix.platform.target }}
89168
path: dist
90169
- name: pytest
91-
if: ${{ !startsWith(matrix.target, 'aarch64') }}
170+
if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
92171
shell: bash
93172
run: |
94173
set -e
95-
pip install pycrc32 --find-links dist --force-reinstall --no-index
174+
python3 -m venv .venv
175+
source .venv/Scripts/activate
176+
pip install pycrc32 --find-links dist --force-reinstall
96177
pip install pytest
97178
pytest
98179
99180
macos:
100-
runs-on: macos-latest
181+
runs-on: ${{ matrix.platform.runner }}
101182
strategy:
102183
matrix:
103-
target: [x86_64, aarch64]
184+
platform:
185+
- runner: macos-13
186+
target: x86_64
187+
- runner: macos-14
188+
target: aarch64
104189
steps:
105190
- uses: actions/checkout@v4
106191
- uses: actions/setup-python@v5
107192
with:
108-
python-version: '3.10'
193+
python-version: 3.x
109194
- name: Build wheels
110195
uses: PyO3/maturin-action@v1
111196
with:
112-
target: ${{ matrix.target }}
197+
target: ${{ matrix.platform.target }}
113198
args: --release --out dist --find-interpreter
114199
sccache: 'true'
115200
- name: Upload wheels
116-
uses: actions/upload-artifact@v3
201+
uses: actions/upload-artifact@v4
117202
with:
118-
name: wheels
203+
name: wheels-macos-${{ matrix.platform.target }}
119204
path: dist
120205
- name: pytest
121-
if: ${{ !startsWith(matrix.target, 'aarch64') }}
122-
shell: bash
123206
run: |
124207
set -e
125-
pip install pycrc32 --find-links dist --force-reinstall --no-index
208+
python3 -m venv .venv
209+
source .venv/bin/activate
210+
pip install pycrc32 --find-links dist --force-reinstall
126211
pip install pytest
127212
pytest
128213
@@ -136,24 +221,34 @@ jobs:
136221
command: sdist
137222
args: --out dist
138223
- name: Upload sdist
139-
uses: actions/upload-artifact@v3
224+
uses: actions/upload-artifact@v4
140225
with:
141-
name: wheels
226+
name: wheels-sdist
142227
path: dist
143228

144229
release:
145230
name: Release
146231
runs-on: ubuntu-latest
147-
if: "startsWith(github.ref, 'refs/tags/')"
148-
needs: [linux, windows, macos, sdist]
232+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
233+
needs: [linux, musllinux, windows, macos, sdist]
234+
permissions:
235+
# Use to sign the release artifacts
236+
id-token: write
237+
# Used to upload release artifacts
238+
contents: write
239+
# Used to generate artifact attestation
240+
attestations: write
149241
steps:
150-
- uses: actions/download-artifact@v3
242+
- uses: actions/download-artifact@v4
243+
- name: Generate artifact attestation
244+
uses: actions/attest-build-provenance@v1
151245
with:
152-
name: wheels
246+
subject-path: 'wheels-*/*'
153247
- name: Publish to PyPI
248+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
154249
uses: PyO3/maturin-action@v1
155250
env:
156251
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
157252
with:
158253
command: upload
159-
args: --non-interactive --skip-existing *
254+
args: --non-interactive --skip-existing wheels-*/*

0 commit comments

Comments
 (0)