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 Python dependencies
43+ working-directory : python
44+ run : |
45+ python -m pip install --upgrade pip
46+ pip install maturin[patchelf]
47+ pip install -e .[tests]
48+ - name : Build Python extension
49+ working-directory : python
50+ run : maturin develop
51+ - name : Run tests
52+ working-directory : python
53+ run : pytest python/tests/ -v
54+ - name : Run doctests
55+ working-directory : python
56+ run : |
57+ if [ -f python/lance_graph/__init__.py ]; then
58+ python -m doctest python/lance_graph/__init__.py || echo "No doctests found"
59+ fi
60+
61+ lint :
62+ runs-on : ubuntu-24.04
63+ timeout-minutes : 15
64+ steps :
65+ - uses : actions/checkout@v4
66+ - name : Set up Python
67+ uses : actions/setup-python@v4
68+ with :
69+ python-version : " 3.11"
70+ - name : Install dependencies
71+ working-directory : python
72+ run : |
73+ python -m pip install --upgrade pip
74+ pip install -e .[dev]
75+ - name : Run ruff format check
76+ working-directory : python
77+ run : ruff format --check python/
78+ - name : Run ruff lint
79+ working-directory : python
80+ run : ruff check python/
81+ - name : Run pyright type check
82+ working-directory : python
83+ run : pyright
0 commit comments