Files
lancedb/ci/cli_wheel/test_install.sh
T
Bruno Ramirez 06e626238d feat(cli): package release binaries as lancedb-tools wheels (#5214)
Python users can install the LanceDB SDK today. This adds a separate
`lancedb-tools` distribution so they can also run the standalone
`lancedb` CLI with `uvx` or install it with `pipx`. The wheels bundle
the same binaries shipped through GitHub Releases for Apple Silicon
macOS, Linux ARM64, and Linux x86-64. The workflow uploads the wheels to
GitHub Actions for testing. PyPI publication will wait for a stable
release.

This was accomplished with the following changes:

- Verify the release archives against `SHA256SUMS` and bundle each
binary with its license and third-party notices in a platform-specific
wheel.
- Add the `lancedb` entry point and document how to build and test
wheels from a release tag.
- Exercise each wheel with both `uvx` and `pipx` on a native runner.

### Testing

All six installation checks passed against `v0.42.0-beta.30` (Python
version `0.42.0b30`). On Apple Silicon macOS, Linux ARM64, and Linux
x86-64, both `uvx` and `pipx` reported `lancedb 0.42.0-beta.30` and
listed the built-in local profile. [Native test results and wheel
artifacts](https://github.com/lancedb/lancedb/actions/runs/45680764524)

Locally verified that all three wheels contain byte-for-byte copies of
the released binary and license notices. All 38 tests in `ci/tests`
discovered by Python unittest passed.
2026-11-25 11:39:12 -08:00

25 lines
941 B
Bash

#!/usr/bin/env bash
# Exercise resolver platform selection and both tools' installed entry points.
set -euo pipefail
tag=${1:?pass the CLI release tag}
wheels=${2:?pass the absolute wheel directory}
version=${tag#v}
spec="lancedb-tools==${version/-beta./b}"
test_env=$(mktemp -d)
trap 'rm -rf "$test_env"' EXIT
export XDG_CONFIG_HOME="$test_env/config" UV_CACHE_DIR="$test_env/uv"
export XDG_STATE_HOME="$test_env/state" XDG_DATA_HOME="$test_env/data"
export PIPX_HOME="$test_env/pipx" PIPX_BIN_DIR="$test_env/bin"
export PIPX_SHARED_LIBS="$test_env/shared" PIPX_MAN_DIR="$test_env/man"
check_cli() {
"$@" --version | grep -Fx "lancedb $version"
"$@" profile list | grep -w local
}
check_cli uvx --no-index --find-links "$wheels" --from "$spec" lancedb
python -m pip download --no-index --find-links "$wheels" --dest "$test_env/native" "$spec"
pipx install --backend pip "$test_env/native/"*.whl
check_cli "$PIPX_BIN_DIR/lancedb"