Repository navigation
75 lines (71 loc) · 2.24 KB
/
Copy pathpython-test.yml
File metadata and controls
75 lines (71 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Python Tests
on:
push:
branches:
- main
pull_request:
paths:
- python/**
- crates/**
- Cargo.toml
- Cargo.lock
- .github/workflows/python-test.yml
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-C debuginfo=1"
CARGO_INCREMENTAL: "0"
jobs:
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: Swatinem/rust-cache@v2
with:
shared-key: "lance-csr-python"
# maturin builds the bindings crate, which sits outside the workspace.
workspaces: crates/lance-csr-python
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install locked dependencies
working-directory: python
# The package itself is built by maturin develop below, in debug mode.
run: uv sync --locked --no-install-project --python ${{ matrix.python-version }}
- name: Build Python extension
working-directory: python
run: uv run --no-sync maturin develop
- name: Run tests
working-directory: python
run: uv run --no-sync pytest python/tests/ --doctest-modules python/lance_csr -v
lint:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Install locked dependencies
working-directory: python
# Linting needs no build of the Rust extension.
run: uv sync --locked --no-install-project --python 3.12
- name: Run ruff format check
working-directory: python
run: uv run --no-sync ruff format --check python/
- name: Run ruff lint
working-directory: python
run: uv run --no-sync ruff check python/
- name: Run pyright type check
working-directory: python
run: uv run --no-sync pyright