-
Notifications
You must be signed in to change notification settings - Fork 3
60 lines (50 loc) · 1.67 KB
/
python-bindings.yml
File metadata and controls
60 lines (50 loc) · 1.67 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
name: Python Bindings Smoke
on:
pull_request:
paths:
- "crates/pyopenquant/**"
- "crates/openquant/**"
- "python/**"
- "pyproject.toml"
- ".github/workflows/python-bindings.yml"
- "justfile"
push:
branches:
- main
paths:
- "crates/pyopenquant/**"
- "crates/openquant/**"
- "python/**"
- "pyproject.toml"
- ".github/workflows/python-bindings.yml"
- "justfile"
jobs:
py-bindings-smoke:
runs-on: ubuntu-latest
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v5
- name: Cache cargo registry + build artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-pybind-${{ hashFiles('Cargo.lock', 'crates/pyopenquant/Cargo.toml', 'crates/openquant/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-pybind-
- name: Create uv virtual environment
run: uv venv --python 3.11 .venv
- name: Build + install extension in current environment
run: uv run --python .venv/bin/python --with maturin maturin develop --manifest-path crates/pyopenquant/Cargo.toml
- name: Import smoke check
run: uv run --python .venv/bin/python python -c "import openquant; print('openquant bindings import ok')"
- name: Run Python binding tests
run: uv run --python .venv/bin/python --with pytest pytest python/tests -q