1+ name : Python Tests
2+ on :
3+ push :
4+ branches :
5+ - main
6+ pull_request :
7+ paths :
8+ - python/**
9+ - rust/lance-graph/**
10+ - .github/workflows/python-test.yml
11+
12+ concurrency :
13+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+ cancel-in-progress : true
15+
16+ env :
17+ CARGO_TERM_COLOR : always
18+ RUSTFLAGS : " -C debuginfo=1"
19+
20+ jobs :
21+ test :
22+ runs-on : ubuntu-24.04
23+ timeout-minutes : 30
24+ strategy :
25+ matrix :
26+ python-version : ["3.11"]
27+ steps :
28+ - uses : actions/checkout@v4
29+ - name : Set up Python ${{ matrix.python-version }}
30+ uses : actions/setup-python@v4
31+ with :
32+ python-version : ${{ matrix.python-version }}
33+ - name : Setup Rust
34+ uses : actions-rust-lang/setup-rust-toolchain@v1
35+ - uses : Swatinem/rust-cache@v2
36+ with :
37+ workspaces : python
38+ - name : Install dependencies
39+ run : |
40+ sudo apt update
41+ sudo apt install -y protobuf-compiler
42+ - name : Install uv
43+ uses : astral-sh/setup-uv@v3
44+ - name : Create virtual environment and install dependencies
45+ working-directory : python
46+ run : |
47+ uv venv
48+ source .venv/bin/activate
49+ uv pip install maturin[patchelf]
50+ uv pip install -e .[tests]
51+ - name : Build Python extension
52+ working-directory : python
53+ run : |
54+ source .venv/bin/activate
55+ maturin develop
56+ - name : Run tests
57+ working-directory : python
58+ run : |
59+ source .venv/bin/activate
60+ pytest python/tests/ -v
61+ - name : Run doctests
62+ working-directory : python
63+ run : |
64+ source .venv/bin/activate
65+ if [ -f python/lance_graph/__init__.py ]; then
66+ python -m doctest python/lance_graph/__init__.py || echo "No doctests found"
67+ fi
68+
69+ lint :
70+ runs-on : ubuntu-24.04
71+ timeout-minutes : 15
72+ steps :
73+ - uses : actions/checkout@v4
74+ - name : Set up Python
75+ uses : actions/setup-python@v4
76+ with :
77+ python-version : " 3.11"
78+ - name : Install uv
79+ uses : astral-sh/setup-uv@v3
80+ - name : Install dependencies
81+ working-directory : python
82+ run : |
83+ uv venv
84+ source .venv/bin/activate
85+ uv pip install -e .[dev]
86+ - name : Run ruff format check
87+ working-directory : python
88+ run : |
89+ source .venv/bin/activate
90+ ruff format --check python/
91+ - name : Run ruff lint
92+ working-directory : python
93+ run : |
94+ source .venv/bin/activate
95+ ruff check python/
96+ - name : Run pyright type check
97+ working-directory : python
98+ run : |
99+ source .venv/bin/activate
100+ pyright
0 commit comments