Skip to content

Commit d6b3c48

Browse files
committed
feat: build wheels
1 parent 493f93f commit d6b3c48

File tree

2 files changed

+34
-58
lines changed

2 files changed

+34
-58
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.ref }}
1111
cancel-in-progress: true
1212

13+
env:
14+
DUCKDB_VERSION: "1.2.0"
15+
1316
jobs:
1417
test:
1518
name: Test
1619
runs-on: ${{ matrix.os }}
1720
env:
18-
DUCKDB_VERSION: "1.2.0"
1921
DUCKDB_LIB_DIR: /opt/duckdb
2022
strategy:
2123
fail-fast: false
@@ -36,7 +38,7 @@ jobs:
3638
- uses: Swatinem/rust-cache@v2
3739
- name: Install Python version
3840
run: uv python install ${{ matrix.python-version }}
39-
- name: Get DuckDB
41+
- name: Install libduckdb
4042
run: |
4143
wget https://github.com/duckdb/duckdb/releases/download/v$DUCKDB_VERSION/libduckdb-linux-amd64.zip
4244
unzip libduckdb-linux-amd64.zip -d /opt/duckdb

.github/workflows/pypi.yaml

Lines changed: 30 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,22 @@ concurrency:
1313
group: wheels
1414
cancel-in-progress: false
1515

16+
env:
17+
DUCKDB_VERSION: "1.2.0"
18+
1619
jobs:
20+
# TODO add bundled builds for platforms where we don't have pre-built libraries
1721
linux:
18-
runs-on: ${{ matrix.platform.runner }}
22+
runs-on: ubuntu-22.04
1923
strategy:
2024
matrix:
2125
platform:
22-
- runner: ubuntu-22.04
23-
target: x86_64
24-
manylinux: auto
25-
- runner: ubuntu-22.04
26-
target: x86
26+
- target: x86_64
2727
manylinux: auto
28-
- runner: ubuntu-22.04
29-
target: aarch64
28+
duckdb-slug: amd64
29+
- target: aarch64
3030
manylinux: "2_28"
31-
- runner: ubuntu-22.04
32-
target: armv7
33-
manylinux: auto
34-
- runner: ubuntu-22.04
35-
target: s390x
36-
manylinux: auto
37-
- runner: ubuntu-22.04
38-
target: ppc64le
39-
manylinux: auto
31+
duckdb-slug: aarch64
4032
steps:
4133
- uses: actions/checkout@v4
4234
- uses: astral-sh/setup-uv@v5
@@ -46,38 +38,44 @@ jobs:
4638
uses: PyO3/maturin-action@v1
4739
with:
4840
target: ${{ matrix.platform.target }}
49-
args: --release --out dist -i 3.10
41+
args: --release --out dist -i 3.10 --auditwheel repair
5042
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5143
manylinux: ${{ matrix.platform.manylinux }}
44+
before-script-linux: |
45+
wget https://github.com/duckdb/duckdb/releases/download/v$DUCKDB_VERSION/libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip
46+
unzip libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip -d /opt/duckdb
47+
export DUCKDB_LIB_DIR=/opt/duckdb
5248
- name: Upload wheels
5349
uses: actions/upload-artifact@v4
5450
with:
5551
name: wheels-linux-${{ matrix.platform.target }}
5652
path: dist
5753

5854
musllinux:
59-
runs-on: ${{ matrix.platform.runner }}
55+
runs-on: ubuntu-22.04
6056
strategy:
6157
matrix:
6258
platform:
63-
- runner: ubuntu-22.04
64-
target: x86_64
65-
- runner: ubuntu-22.04
66-
target: x86
67-
- runner: ubuntu-22.04
68-
target: aarch64
69-
- runner: ubuntu-22.04
70-
target: armv7
59+
- target: x86_64
60+
duckdb-slug: amd64
61+
- target: aarch64
62+
duckdb-slug: aarch64
7163
steps:
7264
- uses: actions/checkout@v4
7365
- uses: astral-sh/setup-uv@v5
7466
- name: Install Pythons
7567
run: uv python install 3.10
68+
- name: Install libduckdb
69+
run: |
70+
wget https://github.com/duckdb/duckdb/releases/download/v$DUCKDB_VERSION/libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip
71+
unzip libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip -d /opt/duckdb
7672
- name: Build wheels
7773
uses: PyO3/maturin-action@v1
74+
env:
75+
DUCKDB_LIB_DIR: /opt/duckdb
7876
with:
7977
target: ${{ matrix.platform.target }}
80-
args: --release --out dist -i 3.10
78+
args: --release --out dist -i 3.10 --auditwheel repair
8179
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
8280
manylinux: musllinux_1_2
8381
- name: Upload wheels
@@ -86,33 +84,6 @@ jobs:
8684
name: wheels-musllinux-${{ matrix.platform.target }}
8785
path: dist
8886

89-
# windows:
90-
# runs-on: ${{ matrix.platform.runner }}
91-
# strategy:
92-
# matrix:
93-
# platform:
94-
# - runner: windows-latest
95-
# target: x64
96-
# - runner: windows-latest
97-
# target: x86
98-
# steps:
99-
# - uses: actions/checkout@v4
100-
# - uses: actions/setup-python@v5
101-
# with:
102-
# python-version: 3.x
103-
# architecture: ${{ matrix.platform.target }}
104-
# - name: Build wheels
105-
# uses: PyO3/maturin-action@v1
106-
# with:
107-
# target: ${{ matrix.platform.target }}
108-
# args: --release --out dist --find-interpreter
109-
# sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
110-
# - name: Upload wheels
111-
# uses: actions/upload-artifact@v4
112-
# with:
113-
# name: wheels-windows-${{ matrix.platform.target }}
114-
# path: dist
115-
11687
macos:
11788
runs-on: ${{ matrix.platform.runner }}
11889
strategy:
@@ -127,12 +98,16 @@ jobs:
12798
- uses: astral-sh/setup-uv@v5
12899
- name: Install Pythons
129100
run: uv python install 3.10
101+
- name: Install delocate
102+
run: uv pip install delocate
130103
- name: Build wheels
131104
uses: PyO3/maturin-action@v1
132105
with:
133106
target: ${{ matrix.platform.target }}
134107
args: --release --out dist -i 3.10
135108
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
109+
- name: Repair wheel
110+
run: delocate-wheel -v dist/*.whl
136111
- name: Upload wheels
137112
uses: actions/upload-artifact@v4
138113
with:
@@ -161,7 +136,6 @@ jobs:
161136
needs:
162137
- linux
163138
- musllinux
164-
# - windows
165139
- macos
166140
- sdist
167141
environment:

0 commit comments

Comments
 (0)