Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 2 additions & 31 deletions .github/workflows/pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,9 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist ${{ matrix.maturin.args }} --auditwheel repair
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
manylinux: ${{ matrix.platform.manylinux }}
before-script-linux: |
if command -v yum &> /dev/null; then
yum install -y unzip
elif command -v apt-get &> /dev/null; then
apt-get update && apt-get install -y unzip
else
echo "No supported package manager found."
exit 1
fi
curl -L -O https://github.com/duckdb/duckdb/releases/download/v1.2.0/libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip
unzip libduckdb-linux-${{ matrix.platform.duckdb-slug }}.zip -d /opt/duckdb
export DUCKDB_LIB_DIR=/opt/duckdb
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand All @@ -75,34 +63,17 @@ jobs:
target: x86_64
- runner: macos-14
target: aarch64
env:
DUCKDB_VERSION: "1.2.0"
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- name: Install Python
run: uv python install 3.10
- name: Install libduckdb
run: |
wget https://github.com/duckdb/duckdb/releases/download/v${DUCKDB_VERSION}/libduckdb-osx-universal.zip
mkdir -p ./opt/duckdb
unzip libduckdb-osx-universal.zip -d ${{ github.workspace }}/opt/duckdb
- name: Install delocate
run: |
uv venv
uv pip install delocate
- name: Build wheels
uses: PyO3/maturin-action@v1
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/opt/duckdb
with:
target: ${{ matrix.platform.target }}
args: --release --out dist ${{ matrix.maturin.args }}
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Repair wheel
run: .venv/bin/delocate-wheel -v dist/*.whl
env:
DYLD_LIBRARY_PATH: ${{ github.workspace }}/opt/duckdb
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ publish = false
name = "stacrs"
crate-type = ["cdylib"]

[features]
duckdb-bundled = ["stac-duckdb/bundled"]

[dependencies]
clap = "4.5.31"
geojson = "0.24.1"
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ We test to ensure [compatibility](https://github.com/stac-utils/stac-rs/blob/mai

## Development

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)).
Get [Rust](https://rustup.rs/), [uv](https://docs.astral.sh/uv/getting-started/installation/), and (optionally) [libduckdb](https://duckdb.org/docs/installation/index).
Then:

```shell
Expand All @@ -143,10 +143,6 @@ scripts/test

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

> [!TIP]
> We ship our wheels with **libduckdb** so users don't have to worry about having it installed.
> You only need it if you're doing development.

### DuckDB

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

> [!NOTE]
> 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.
Alternatively, you can use the `duckdb-bundled` feature to build DuckDB bindings into the Rust library:

```shell
maturin dev --uv -F duckdb-bundled && pytest
```

> [!WARNING]
> Building DuckDB [bundled](https://github.com/duckdb/duckdb-rs?tab=readme-ov-file#notes-on-building-duckdb-and-libduckdb-sys) takes a long while.

## License

Expand Down
Loading