Skip to content

Commit 6d6e567

Browse files
authored
chore: more duckdb fiddling (#61)
1 parent 5394439 commit 6d6e567

File tree

4 files changed

+15
-38
lines changed

4 files changed

+15
-38
lines changed

.github/workflows/pypi.yaml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,9 @@ jobs:
4040
uses: PyO3/maturin-action@v1
4141
with:
4242
target: ${{ matrix.platform.target }}
43-
args: --release --out dist ${{ matrix.maturin.args }} --auditwheel repair
43+
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
4444
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
4545
manylinux: ${{ matrix.platform.manylinux }}
46-
before-script-linux: |
47-
if command -v yum &> /dev/null; then
48-
yum install -y unzip
49-
elif command -v apt-get &> /dev/null; then
50-
apt-get update && apt-get install -y unzip
51-
else
52-
echo "No supported package manager found."
53-
exit 1
54-
fi
55-
curl -L -O https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip
56-
unzip libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip -d /opt/duckdb
57-
export DUCKDB_LIB_DIR=/opt/duckdb
5846
- name: Upload wheels
5947
uses: actions/upload-artifact@v4
6048
with:
@@ -75,34 +63,17 @@ jobs:
7563
target: x86_64
7664
- runner: macos-14
7765
target: aarch64
78-
env:
79-
DUCKDB_VERSION: "1.2.0"
8066
steps:
8167
- uses: actions/checkout@v4
8268
- uses: astral-sh/setup-uv@v5
8369
- name: Install Python
8470
run: uv python install 3.10
85-
- name: Install libduckdb
86-
run: |
87-
wget https://github.com/duckdb/duckdb/releases/download/v${DUCKDB_VERSION}/libduckdb-osx-universal.zip
88-
mkdir -p ./opt/duckdb
89-
unzip libduckdb-osx-universal.zip -d ${{ github.workspace }}/opt/duckdb
90-
- name: Install delocate
91-
run: |
92-
uv venv
93-
uv pip install delocate
9471
- name: Build wheels
9572
uses: PyO3/maturin-action@v1
96-
env:
97-
DUCKDB_LIB_DIR: ${{ github.workspace }}/opt/duckdb
9873
with:
9974
target: ${{ matrix.platform.target }}
100-
args: --release --out dist ${{ matrix.maturin.args }}
75+
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
10176
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
102-
- name: Repair wheel
103-
run: .venv/bin/delocate-wheel -v dist/*.whl
104-
env:
105-
DYLD_LIBRARY_PATH: ${{ github.workspace }}/opt/duckdb
10677
- name: Upload wheels
10778
uses: actions/upload-artifact@v4
10879
with:

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ publish = false
88
name = "stacrs"
99
crate-type = ["cdylib"]
1010

11+
[features]
12+
duckdb-bundled = ["stac-duckdb/bundled"]
13+
1114
[dependencies]
1215
clap = "4.5.31"
1316
geojson = "0.24.1"

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ We test to ensure [compatibility](https://github.com/stac-utils/stac-rs/blob/mai
132132

133133
## Development
134134

135-
Get [Rust](https://rustup.rs/), [uv](https://docs.astral.sh/uv/getting-started/installation/), and [libduckdb](https://duckdb.org/docs/installation/index) (for more on setting up **libduckdb**, [see this](#duckdb)).
135+
Get [Rust](https://rustup.rs/), [uv](https://docs.astral.sh/uv/getting-started/installation/), and (optionally) [libduckdb](https://duckdb.org/docs/installation/index).
136136
Then:
137137

138138
```shell
@@ -143,10 +143,6 @@ scripts/test
143143

144144
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information about contributing to this project.
145145

146-
> [!TIP]
147-
> We ship our wheels with **libduckdb** so users don't have to worry about having it installed.
148-
> You only need it if you're doing development.
149-
150146
### DuckDB
151147

152148
By default, this package expects **libduckdb** to be present on your system.
@@ -163,8 +159,14 @@ If you're using [homebrew](https://brew.sh/), that might look like this:
163159
export DUCKDB_LIB_DIR=/opt/homebrew/lib
164160
```
165161

166-
> [!NOTE]
167-
> We used to use the [bundled](https://github.com/duckdb/duckdb-rs?tab=readme-ov-file#notes-on-building-duckdb-and-libduckdb-sys) feature of DuckDB, but it was making our build times intolerably slow.
162+
Alternatively, you can use the `duckdb-bundled` feature to build DuckDB bindings into the Rust library:
163+
164+
```shell
165+
maturin dev --uv -F duckdb-bundled && pytest
166+
```
167+
168+
> [!WARNING]
169+
> Building DuckDB [bundled](https://github.com/duckdb/duckdb-rs?tab=readme-ov-file#notes-on-building-duckdb-and-libduckdb-sys) takes a long while.
168170
169171
## License
170172

0 commit comments

Comments
 (0)