Skip to content

Commit cc17368

Browse files
committed
Use io template
1 parent 87e6109 commit cc17368

1 file changed

Lines changed: 138 additions & 89 deletions

File tree

.github/workflows/python-wheels.yml

Lines changed: 138 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# This file is autogenerated by maturin v1.7.1
2-
# To update, run
3-
#
4-
# maturin generate-ci -m python/Cargo.toml --platform all -o tmp.yml github
5-
#
6-
7-
# Wheel builds for Python libraries that are pure-Rust with no complex
8-
# dependencies (no C dependencies, no http fetching deps)
9-
name: Python wheels
1+
name: Python Wheels
102

113
on:
124
push:
@@ -18,9 +10,6 @@ concurrency:
1810
group: ${{ github.workflow }}-${{ github.ref }}
1911
cancel-in-progress: true
2012

21-
permissions:
22-
contents: read
23-
2413
jobs:
2514
linux:
2615
runs-on: ${{ matrix.platform.runner }}
@@ -29,140 +18,206 @@ jobs:
2918
platform:
3019
- runner: ubuntu-latest
3120
target: x86_64
21+
manylinux: auto
3222
- runner: ubuntu-latest
3323
target: x86
24+
manylinux: auto
3425
- runner: ubuntu-latest
3526
target: aarch64
27+
manylinux: "2_28"
3628
- runner: ubuntu-latest
3729
target: armv7
38-
# - runner: ubuntu-latest
39-
# target: s390x
30+
manylinux: auto
4031
- runner: ubuntu-latest
4132
target: ppc64le
33+
manylinux: auto
4234
steps:
4335
- uses: actions/checkout@v4
44-
- uses: actions/setup-python@v5
36+
37+
- name: Install uv
38+
uses: astral-sh/setup-uv@v3
4539
with:
46-
python-version: 3.x
40+
enable-cache: true
41+
version: "0.8.x"
42+
43+
- name: Install Python versions
44+
run: uv python install 3.9 3.10 3.11 3.12 3.13 pypy3.10
45+
4746
- name: Build wheels
4847
uses: PyO3/maturin-action@v1
4948
with:
5049
target: ${{ matrix.platform.target }}
51-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/Cargo.toml
50+
# As of Nov 2024, it was necessary to manually specify -i 3.13 to get
51+
# maturin to find the executable. --find-interpreter did not find it.
52+
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
5253
sccache: "true"
53-
manylinux: auto
54+
manylinux: ${{ matrix.platform.manylinux }}
55+
5456
- name: Upload wheels
5557
uses: actions/upload-artifact@v4
5658
with:
5759
name: wheels-linux-${{ matrix.platform.target }}
5860
path: dist
5961

60-
# Commented out because rust 1.82 apparently isn't distributed yet (as of Nov 13, 2024) for musllinux? See https://github.com/geoarrow/geoarrow-rs/pull/860
61-
# musllinux:
62-
# runs-on: ${{ matrix.platform.runner }}
63-
# strategy:
64-
# matrix:
65-
# platform:
66-
# - runner: ubuntu-latest
67-
# target: x86_64
68-
# - runner: ubuntu-latest
69-
# target: x86
70-
# - runner: ubuntu-latest
71-
# target: aarch64
72-
# - runner: ubuntu-latest
73-
# target: armv7
74-
# steps:
75-
# - uses: actions/checkout@v4
76-
# - uses: actions/setup-python@v5
77-
# with:
78-
# python-version: 3.x
79-
# - name: Build wheels
80-
# uses: PyO3/maturin-action@v1
81-
# with:
82-
# target: ${{ matrix.platform.target }}
83-
# args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/Cargo.toml
84-
# sccache: "true"
85-
# manylinux: musllinux_1_2
86-
# - name: Upload wheels
87-
# uses: actions/upload-artifact@v4
88-
# with:
89-
# name: wheels-musllinux-${{ matrix.platform.target }}
90-
# path: dist
91-
92-
windows:
62+
macos:
63+
name: Build ${{ matrix.platform.target }} wheels on ${{ matrix.platform.runner }}
9364
runs-on: ${{ matrix.platform.runner }}
9465
strategy:
66+
fail-fast: false
9567
matrix:
9668
platform:
97-
- runner: windows-latest
98-
target: x64
99-
- runner: windows-latest
100-
target: x86
69+
- runner: macos-13
70+
target: x86_64
71+
- runner: macos-14
72+
target: aarch64
10173
steps:
10274
- uses: actions/checkout@v4
103-
- uses: actions/setup-python@v5
75+
- uses: actions/setup-python@v4
10476
with:
10577
python-version: 3.x
106-
architecture: ${{ matrix.platform.target }}
107-
- name: Build wheels
78+
79+
- uses: dtolnay/rust-toolchain@stable
80+
81+
- name: Build wheels - ${{ matrix.platform.target }}
10882
uses: PyO3/maturin-action@v1
10983
with:
11084
target: ${{ matrix.platform.target }}
111-
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 --manifest-path python/Cargo.toml
85+
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/Cargo.toml
11286
sccache: "true"
87+
88+
- name: Install built wheel - ${{ matrix.platform.target }}
89+
run: |
90+
pip install geodatafusion --find-links dist --force-reinstall
91+
python -c "import geodatafusion"
92+
11393
- name: Upload wheels
11494
uses: actions/upload-artifact@v4
11595
with:
116-
name: wheels-windows-${{ matrix.platform.target }}
96+
name: wheels-macos-${{ matrix.platform.target }}
11797
path: dist
11898

119-
macos:
120-
runs-on: ${{ matrix.platform.runner }}
99+
windows:
100+
runs-on: windows-latest
121101
strategy:
122102
matrix:
123-
platform:
124-
# Commented out because rust 1.82 apparently isn't distributed yet (as of Nov 13, 2024) for x86_64-apple-darwin? See https://github.com/geoarrow/geoarrow-rs/pull/860
125-
# - runner: macos-13
126-
# target: x86_64
127-
- runner: macos-14
128-
target: aarch64
103+
target: [x64, x86]
129104
steps:
130105
- uses: actions/checkout@v4
131-
- uses: actions/setup-python@v5
106+
107+
- uses: actions/setup-python@v4
132108
with:
133-
python-version: 3.x
109+
python-version: 3.11
110+
architecture: ${{ matrix.target }}
111+
112+
- uses: dtolnay/rust-toolchain@stable
113+
134114
- name: Build wheels
135115
uses: PyO3/maturin-action@v1
136116
with:
137-
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
139-
sccache: "true"
117+
target: ${{ matrix.target }}
118+
args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/Cargo.toml
119+
120+
- name: Install built wheel
121+
run: |
122+
pip install geodatafusion --find-links dist --force-reinstall
123+
python -c "import geodatafusion"
124+
140125
- name: Upload wheels
141126
uses: actions/upload-artifact@v4
142127
with:
143-
name: wheels-macos-${{ matrix.platform.target }}
128+
name: wheels-windows-${{ matrix.target }}
144129
path: dist
145130

146-
# sdist:
131+
# NOTE: musllinux builds are commented out because importing them failed with:
132+
# ImportError: Error loading shared library libgcc_s-60abea67.so.1: No such file or directory
133+
134+
# musllinux:
147135
# runs-on: ubuntu-latest
136+
# strategy:
137+
# matrix:
138+
# target:
139+
# - x86_64-unknown-linux-musl
140+
# - i686-unknown-linux-musl
148141
# steps:
149142
# - uses: actions/checkout@v4
150-
# - name: Build sdist
143+
# - uses: actions/setup-python@v4
144+
# with:
145+
# python-version: 3.x
146+
# architecture: x64
147+
148+
# - name: Build wheels
151149
# uses: PyO3/maturin-action@v1
152150
# with:
153-
# command: sdist
154-
# args: --out dist --manifest-path python/Cargo.toml
155-
# - name: Upload sdist
156-
# uses: actions/upload-artifact@v4
151+
# target: ${{ matrix.target }}
152+
# manylinux: musllinux_1_2
153+
# args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/Cargo.toml
154+
155+
# - name: Install built wheel
156+
# if: matrix.target == 'x86_64-unknown-linux-musl'
157+
# uses: addnab/docker-run-action@v3
158+
# with:
159+
# image: alpine:latest
160+
# options: -v ${{ github.workspace }}:/io -w /io
161+
# run: |
162+
# apk add py3-pip
163+
# pip3 install -U pip
164+
# pip3 install geodatafusion --find-links /io/dist/ --force-reinstall
165+
# python3 -c "import geodatafusion"
166+
167+
# - name: Upload wheels
168+
# uses: actions/upload-artifact@v3
169+
# with:
170+
# name: wheels
171+
# path: dist
172+
173+
# musllinux-cross:
174+
# runs-on: ubuntu-latest
175+
# strategy:
176+
# matrix:
177+
# platform:
178+
# - target: aarch64-unknown-linux-musl
179+
# arch: aarch64
180+
# - target: armv7-unknown-linux-musleabihf
181+
# arch: armv7
182+
183+
# steps:
184+
# - uses: actions/checkout@v4
185+
186+
# - uses: actions/setup-python@v4
187+
# with:
188+
# python-version: 3.x
189+
190+
# - name: Build wheels
191+
# uses: PyO3/maturin-action@v1
192+
# with:
193+
# target: ${{ matrix.platform.target }}
194+
# manylinux: musllinux_1_2
195+
# args: --release --out dist -i 3.9 -i 3.10 -i 3.11 -i 3.12 -i 3.13 -m python/geoarrow-io/Cargo.toml
196+
197+
# - uses: uraimo/run-on-arch-action@v2.5.1
198+
# name: Install built wheel
199+
# with:
200+
# arch: ${{ matrix.platform.arch }}
201+
# distro: alpine_latest
202+
# githubToken: ${{ github.token }}
203+
# install: |
204+
# apk add py3-pip
205+
# pip3 install -U pip
206+
# run: |
207+
# pip3 install geoarrow-rust-io --find-links dist/ --force-reinstall
208+
# python3 -c "import geoarrow.rust.io"
209+
210+
# - name: Upload wheels
211+
# uses: actions/upload-artifact@v3
157212
# with:
158-
# name: wheels-sdist
213+
# name: wheels
159214
# path: dist
160215

161216
release:
162217
name: Release
163218
runs-on: ubuntu-latest
164-
if: startsWith(github.ref, 'refs/tags/')
165-
needs: [linux, windows, macos]
219+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
220+
needs: [macos, windows, linux]
166221
permissions:
167222
# Used to upload release artifacts
168223
contents: write
@@ -175,9 +230,3 @@ jobs:
175230
with:
176231
command: upload
177232
args: --non-interactive --skip-existing wheels-*/*
178-
# - name: Upload to GitHub Release
179-
# uses: softprops/action-gh-release@v1
180-
# with:
181-
# files: |
182-
# wasm-wheels/*.whl
183-
# prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}

0 commit comments

Comments
 (0)