Skip to content

Commit b7a8893

Browse files
authored
feat: don't bundle duckdb (#52)
- Closes #51
1 parent 231bd72 commit b7a8893

File tree

7 files changed

+132
-160
lines changed

7 files changed

+132
-160
lines changed

.github/workflows/ci.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,17 @@ 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
16-
runs-on: ${{ matrix.os }}
19+
runs-on: ${{ matrix.os.runner }}
20+
env:
21+
DUCKDB_LIB_DIR: ${{ github.workspace }}/opt/duckdb
22+
LD_LIBRARY_PATH: ${{ github.workspace }}/opt/duckdb
23+
DYLD_LIBRARY_PATH: ${{ github.workspace }}/opt/duckdb
1724
strategy:
1825
fail-fast: false
1926
matrix:
@@ -23,8 +30,10 @@ jobs:
2330
- "3.12"
2431
- "3.13"
2532
os:
26-
- ubuntu-latest
27-
- macos-latest
33+
- runner: ubuntu-latest
34+
duckdb-slug: linux-amd64
35+
- runner: macos-latest
36+
duckdb-slug: osx-universal
2837
# https://github.com/stac-utils/stacrs/issues/1
2938
# - windows-latest
3039
steps:
@@ -33,6 +42,11 @@ jobs:
3342
- uses: Swatinem/rust-cache@v2
3443
- name: Install Python version
3544
run: uv python install ${{ matrix.python-version }}
45+
- name: Install libduckdb
46+
run: |
47+
wget https://github.com/duckdb/duckdb/releases/download/v${{ env.duckdb-version }}/libduckdb-${{ matrix.os.duckdb-slug }}.zip
48+
mkdir -p ${{ github.workspace }}/opt/duckdb
49+
unzip libduckdb-${{ matrix.os.duckdb-slug }}.zip -d ${{ github.workspace }}/opt/duckdb
3650
- name: Sync
3751
run: uv sync --no-install-project
3852
- name: Build directly with maturin

.github/workflows/pypi.yaml

Lines changed: 37 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,18 @@ concurrency:
1414
cancel-in-progress: false
1515

1616
jobs:
17+
# TODO add bundled builds for platforms where we don't have pre-built libraries
1718
linux:
18-
runs-on: ${{ matrix.platform.runner }}
19+
runs-on: ubuntu-22.04
1920
strategy:
2021
matrix:
2122
platform:
22-
- runner: ubuntu-22.04
23-
target: x86_64
23+
- target: x86_64
2424
manylinux: auto
25-
- runner: ubuntu-22.04
26-
target: x86
27-
manylinux: auto
28-
- runner: ubuntu-22.04
29-
target: aarch64
25+
duckdb-slug: amd64
26+
- target: aarch64
3027
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
28+
duckdb-slug: aarch64
4029
steps:
4130
- uses: actions/checkout@v4
4231
- uses: astral-sh/setup-uv@v5
@@ -46,73 +35,27 @@ jobs:
4635
uses: PyO3/maturin-action@v1
4736
with:
4837
target: ${{ matrix.platform.target }}
49-
args: --release --out dist -i 3.10
38+
args: --release --out dist -i 3.10 --auditwheel repair
5039
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
5140
manylinux: ${{ matrix.platform.manylinux }}
41+
before-script-linux: |
42+
if command -v yum &> /dev/null; then
43+
yum install -y unzip
44+
elif command -v apt-get &> /dev/null; then
45+
apt-get update && apt-get install -y unzip
46+
else
47+
echo "No supported package manager found."
48+
exit 1
49+
fi
50+
curl -L -O https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip
51+
unzip libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip -d /opt/duckdb
52+
export DUCKDB_LIB_DIR=/opt/duckdb
5253
- name: Upload wheels
5354
uses: actions/upload-artifact@v4
5455
with:
5556
name: wheels-linux-${{ matrix.platform.target }}
5657
path: dist
5758

58-
musllinux:
59-
runs-on: ${{ matrix.platform.runner }}
60-
strategy:
61-
matrix:
62-
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
71-
steps:
72-
- uses: actions/checkout@v4
73-
- uses: astral-sh/setup-uv@v5
74-
- name: Install Pythons
75-
run: uv python install 3.10
76-
- name: Build wheels
77-
uses: PyO3/maturin-action@v1
78-
with:
79-
target: ${{ matrix.platform.target }}
80-
args: --release --out dist -i 3.10
81-
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
82-
manylinux: musllinux_1_2
83-
- name: Upload wheels
84-
uses: actions/upload-artifact@v4
85-
with:
86-
name: wheels-musllinux-${{ matrix.platform.target }}
87-
path: dist
88-
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-
11659
macos:
11760
runs-on: ${{ matrix.platform.runner }}
11861
strategy:
@@ -122,17 +65,34 @@ jobs:
12265
target: x86_64
12366
- runner: macos-14
12467
target: aarch64
68+
env:
69+
DUCKDB_VERSION: "1.2.0"
12570
steps:
12671
- uses: actions/checkout@v4
12772
- uses: astral-sh/setup-uv@v5
128-
- name: Install Pythons
73+
- name: Install Python
12974
run: uv python install 3.10
75+
- name: Install libduckdb
76+
run: |
77+
wget https://github.com/duckdb/duckdb/releases/download/v${DUCKDB_VERSION}/libduckdb-osx-universal.zip
78+
mkdir -p ./opt/duckdb
79+
unzip libduckdb-osx-universal.zip -d ${{ github.workspace }}/opt/duckdb
80+
- name: Install delocate
81+
run: |
82+
uv venv
83+
uv pip install delocate
13084
- name: Build wheels
13185
uses: PyO3/maturin-action@v1
86+
env:
87+
DUCKDB_LIB_DIR: ${{ github.workspace }}/opt/duckdb
13288
with:
13389
target: ${{ matrix.platform.target }}
13490
args: --release --out dist -i 3.10
13591
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
92+
- name: Repair wheel
93+
run: .venv/bin/delocate-wheel -v dist/*.whl
94+
env:
95+
DYLD_LIBRARY_PATH: ${{ github.workspace }}/opt/duckdb
13696
- name: Upload wheels
13797
uses: actions/upload-artifact@v4
13898
with:
@@ -160,8 +120,6 @@ jobs:
160120
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
161121
needs:
162122
- linux
163-
- musllinux
164-
# - windows
165123
- macos
166124
- sdist
167125
environment:

0 commit comments

Comments
 (0)