refactor: move encodings to lance-core #4355
Workflow file for this run
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
name: Python | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
paths: | |
- python/** | |
- rust/** | |
- protos/** | |
- .github/workflows/python.yml | |
- .github/workflows/build_linux_wheel/** | |
- .github/workflows/build_mac_wheel/** | |
- .github/workflows/run_tests/** | |
env: | |
# This env var is used by Swatinem/rust-cache@v2 for the cache | |
# key, so we set it to make sure it is always consistent. | |
CARGO_TERM_COLOR: always | |
# Disable full debug symbol generation to speed up CI build and keep memory down | |
# "1" means line tables only, which is useful for panic tracebacks. | |
RUSTFLAGS: "-C debuginfo=1" | |
RUST_BACKTRACE: "1" | |
CI: "true" | |
jobs: | |
lint: | |
timeout-minutes: 45 | |
runs-on: "ubuntu-22.04" | |
defaults: | |
run: | |
shell: bash | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
- name: Install linting tools | |
run: | | |
pip install black isort ruff maturin tensorflow tqdm | |
pip install torch --index-url https://download.pytorch.org/whl/cpu | |
- name: Lint Python | |
run: | | |
black --check python | |
isort --check-only python | |
ruff check python | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y protobuf-compiler libssl-dev | |
- name: Lint Rust | |
run: | | |
cargo fmt --all -- --check | |
cargo clippy --all-features --tests -- -D warnings | |
- name: Build | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install torch tqdm --index-url https://download.pytorch.org/whl/cpu | |
maturin develop --extras tests | |
- name: Run doctest | |
run: | | |
source venv/bin/activate | |
pytest --doctest-modules python/lance | |
linux: | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
python-minor-version: [ "8", "9", "10", "11" ] | |
runs-on: "ubuntu-22.04" | |
defaults: | |
run: | |
shell: bash | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.${{ matrix.python-minor-version }} | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
prefix-key: "manylinux2014" # use this to flush the cache | |
- uses: ./.github/workflows/build_linux_wheel | |
- uses: ./.github/workflows/run_tests | |
# Make sure wheels are not included in the Rust cache | |
- name: Delete wheels | |
run: sudo rm -rf target/wheels | |
linux-arm: | |
timeout-minutes: 45 | |
strategy: | |
matrix: | |
python-minor-version: [ "11" ] | |
runs-on: buildjet-4vcpu-ubuntu-2204-arm | |
defaults: | |
run: | |
shell: bash | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Set up Python | |
run: | | |
sudo apt update | |
sudo apt install wget software-properties-common | |
sudo add-apt-repository ppa:deadsnakes/ppa | |
sudo apt install python3.${{ matrix.python-minor-version }} | |
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.${{ matrix.python-minor-version }} 1 | |
sudo apt install python3-pip | |
sudo apt install python3.${{ matrix.python-minor-version }}-distutils | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
prefix-key: "manylinux2014" # use this to flush the cache | |
- uses: ./.github/workflows/build_linux_wheel | |
with: | |
arm-build: "true" | |
- uses: ./.github/workflows/run_tests | |
# Make sure wheels are not included in the Rust cache | |
- name: Delete wheels | |
run: sudo rm -rf target/wheels | |
mac: | |
timeout-minutes: 45 | |
runs-on: "macos-12" | |
defaults: | |
run: | |
shell: bash | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
- uses: ./.github/workflows/build_mac_wheel | |
- uses: ./.github/workflows/run_tests | |
# Make sure wheels are not included in the Rust cache | |
- name: Delete wheels | |
run: rm -rf target/wheels | |
windows: | |
runs-on: windows-latest | |
timeout-minutes: 90 | |
defaults: | |
run: | |
shell: powershell | |
working-directory: python | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
- uses: ./.github/workflows/build_windows_wheel | |
- uses: ./.github/workflows/run_tests | |
aws-integtest: | |
timeout-minutes: 45 | |
runs-on: "ubuntu-latest" | |
defaults: | |
run: | |
shell: bash | |
working-directory: python | |
services: | |
minio: | |
image: lazybit/minio | |
ports: | |
- 9000:9000 | |
env: | |
MINIO_ACCESS_KEY: ACCESSKEY | |
MINIO_SECRET_KEY: SECRETKEY | |
options: --name=minio --health-cmd "curl http://localhost:9000/minio/health/live" | |
dynamodb-local: | |
image: amazon/dynamodb-local | |
ports: | |
- 8000:8000 | |
env: | |
AWS_ACCESS_KEY_ID: ACCESSKEY | |
AWS_SECRET_ACCESS_KEY: SECRETKEY | |
env: | |
AWS_ACCESS_KEY_ID: ACCESSKEY | |
AWS_SECRET_ACCESS_KEY: SECRETKEY | |
AWS_REGION: us-west-2 | |
# this one is for s3 | |
AWS_ENDPOINT: http://localhost:9000 | |
# this one is for dynamodb | |
DYNAMODB_ENDPOINT: http://localhost:8000 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: create s3 | |
run: aws s3 mb s3://lance-integtest --endpoint http://localhost:9000 | |
- name: create ddb | |
run: | | |
aws dynamodb create-table \ | |
--table-name lance-integtest \ | |
--attribute-definitions '[{"AttributeName": "base_uri", "AttributeType": "S"}, {"AttributeName": "version", "AttributeType": "N"}]' \ | |
--key-schema '[{"AttributeName": "base_uri", "KeyType": "HASH"}, {"AttributeName": "version", "KeyType": "RANGE"}]' \ | |
--provisioned-throughput '{"ReadCapacityUnits": 10, "WriteCapacityUnits": 10}' \ | |
--endpoint-url http://localhost:8000 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
workspaces: python | |
prefix-key: "manylinux2014" # use this to flush the cache | |
- uses: ./.github/workflows/build_linux_wheel | |
- name: Install dependencies | |
run: | |
pip install torch --index-url https://download.pytorch.org/whl/cpu | |
- uses: ./.github/workflows/run_integtests | |
# Make sure wheels are not included in the Rust cache | |
- name: Delete wheels | |
run: sudo rm -rf target/wheels |