bench(py): track per-function data-processing metrics #26
This file contains hidden or 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 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 |