Inspect R API update 0a17efca92b59e275c0499118d8c05684aa9880c #322
Workflow file for this run
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: Native backend CI | |
| on: | |
| pull_request: | |
| push: | |
| jobs: | |
| native-backend: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install build tools | |
| run: | | |
| python -m pip install -U pip | |
| # numpy pinned <2.5: the R parity cache keys hash test inputs generated via | |
| # multivariate_normal (LAPACK SVD). numpy 2.5.x bundles an OpenBLAS whose SVD | |
| # kernels differ on some runner CPUs, changing inputs bit-for-bit and causing | |
| # cache misses. Re-evaluate at the next full live-R cache regeneration. | |
| python -m pip install build scikit-build-core nanobind pytest ruff mypy "numpy<2.5" scipy | |
| python -m pip install hypothesis pytest-benchmark pytest-xdist | |
| - name: Install package editable | |
| run: python -m pip install -e . | |
| - name: Run native import smoke test | |
| run: python -c "import nns._nnscore as c; print(c.lpm(2.0, 0.0, [-2.0, -1.0, 0.5, 3.0]))" | |
| - name: Run invariants without Rscript | |
| run: python -m pytest -q tests/invariants | |
| - name: Run parity from committed R cache | |
| run: NNS_R_CACHE_ONLY=1 python -m pytest -q tests/parity | |
| - name: Run plotting color-fidelity tests | |
| run: python -m pytest -q tests/plotting | |
| - name: Run vignette examples | |
| run: | | |
| if [ -f tests/docs/test_vignette_examples.py ]; then | |
| python -m pytest -q tests/docs/test_vignette_examples.py | |
| else | |
| echo "No docs vignette test present; skipping." | |
| fi | |
| - name: Run ruff | |
| run: ruff check . | |
| - name: Run mypy | |
| run: mypy | |
| - name: Build distributions | |
| run: python -m build |