forked from lancedb/lancedb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a basic async python client starting point (lancedb#1014)
This changes `lancedb` from a "pure python" setuptools project to a maturin project and adds a rust lancedb dependency. The async python client is extremely minimal (only `connect` and `Connection.table_names` are supported). The purpose of this PR is to get the infrastructure in place for building out the rest of the async client. Although this is not technically a breaking change (no APIs are changing) it is still a considerable change in the way the wheels are built because they now include the native shared library.
- Loading branch information
1 parent
464a36a
commit 2cec2a8
Showing
73 changed files
with
1,027 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# We create a composite action to be re-used both for testing and for releasing | ||
name: build-linux-wheel | ||
description: "Build a manylinux wheel for lance" | ||
inputs: | ||
python-minor-version: | ||
description: "8, 9, 10, 11, 12" | ||
required: true | ||
args: | ||
description: "--release" | ||
required: false | ||
default: "" | ||
arm-build: | ||
description: "Build for arm64 instead of x86_64" | ||
# Note: this does *not* mean the host is arm64, since we might be cross-compiling. | ||
required: false | ||
default: "false" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: CONFIRM ARM BUILD | ||
shell: bash | ||
run: | | ||
echo "ARM BUILD: ${{ inputs.arm-build }}" | ||
- name: Build x86_64 Manylinux wheel | ||
if: ${{ inputs.arm-build == 'false' }} | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
working-directory: python | ||
target: x86_64-unknown-linux-gnu | ||
manylinux: "2_17" | ||
args: ${{ inputs.args }} | ||
before-script-linux: | | ||
set -e | ||
yum install -y openssl-devel \ | ||
&& curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$(uname -m).zip > /tmp/protoc.zip \ | ||
&& unzip /tmp/protoc.zip -d /usr/local \ | ||
&& rm /tmp/protoc.zip | ||
- name: Build Arm Manylinux Wheel | ||
if: ${{ inputs.arm-build == 'true' }} | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
working-directory: python | ||
target: aarch64-unknown-linux-gnu | ||
manylinux: "2_24" | ||
args: ${{ inputs.args }} | ||
before-script-linux: | | ||
set -e | ||
apt install -y unzip | ||
if [ $(uname -m) = "x86_64" ]; then | ||
PROTOC_ARCH="x86_64" | ||
else | ||
PROTOC_ARCH="aarch_64" | ||
fi | ||
curl -L https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protoc-24.4-linux-$PROTOC_ARCH.zip > /tmp/protoc.zip \ | ||
&& unzip /tmp/protoc.zip -d /usr/local \ | ||
&& rm /tmp/protoc.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# We create a composite action to be re-used both for testing and for releasing | ||
name: build_wheel | ||
description: "Build a lance wheel" | ||
inputs: | ||
python-minor-version: | ||
description: "8, 9, 10, 11" | ||
required: true | ||
args: | ||
description: "--release" | ||
required: false | ||
default: "" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install macos dependency | ||
shell: bash | ||
run: | | ||
brew install protobuf | ||
- name: Build wheel | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
args: ${{ inputs.args }} | ||
working-directory: python | ||
interpreter: 3.${{ inputs.python-minor-version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# We create a composite action to be re-used both for testing and for releasing | ||
name: build_wheel | ||
description: "Build a lance wheel" | ||
inputs: | ||
python-minor-version: | ||
description: "8, 9, 10, 11" | ||
required: true | ||
args: | ||
description: "--release" | ||
required: false | ||
default: "" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Install Protoc v21.12 | ||
working-directory: C:\ | ||
run: | | ||
New-Item -Path 'C:\protoc' -ItemType Directory | ||
Set-Location C:\protoc | ||
Invoke-WebRequest https://github.com/protocolbuffers/protobuf/releases/download/v21.12/protoc-21.12-win64.zip -OutFile C:\protoc\protoc.zip | ||
7z x protoc.zip | ||
Add-Content $env:GITHUB_PATH "C:\protoc\bin" | ||
shell: powershell | ||
- name: Build wheel | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
command: build | ||
args: ${{ inputs.args }} | ||
working-directory: python | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: windows-wheels | ||
path: python\target\wheels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.