Skip to content

feat: 3 big user-facing QoL helpers (parsed.* namespace + find_* + li… #227

feat: 3 big user-facing QoL helpers (parsed.* namespace + find_* + li…

feat: 3 big user-facing QoL helpers (parsed.* namespace + find_* + li… #227

Workflow file for this run

# Run the full test suite (live API tests included) on every PR, push to
# main, and workflow_dispatch. Live tests are gated by SDV_PY_LIVE_TESTS=1
# and run by default; the workflow_dispatch input can flip them off
# (live_tests: "false") for runs where third-party API churn would
# produce false-negative failures.
#
# Uses `uv sync --all-extras --all-groups` against the committed uv.lock for
# reproducible installs, then `uv run --frozen pytest` for execution. See
# CONTRIBUTING.md.
name: tests
on:
pull_request:
push:
branches: [main]
workflow_dispatch:
inputs:
live_tests:
description: "Set SDV_PY_LIVE_TESTS=1 to include live API tests"
required: false
default: "true"
# Cancel in-flight runs on the same ref when a new push comes in.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: pytest (${{ matrix.os }} / py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# CONTRIBUTING.md promises CI runs against the floor (3.9) and the
# canonical version (3.13.2). 3.14 is intentionally NOT included
# yet — pyarrow / polars wheels for cp314 are still landing across
# the index.
os: [ubuntu-latest]
python-version: ["3.9", "3.13.2"]
include:
# Sanity-check the canonical interpreter on macOS + Windows so
# platform-specific regressions surface in CI rather than at
# release time. The matrix stays small (3 ubuntu-runs cost
# nothing; macos / windows runners are billed at higher rates).
- os: macos-latest
python-version: "3.13.2"
- os: windows-latest
python-version: "3.13.2"
steps:
- uses: actions/checkout@v5
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "latest"
enable-cache: true
# Cache key tracks the lockfile; re-resolves on dep bumps.
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.python-version }}
run: uv python install ${{ matrix.python-version }}
# pyreadr 0.5.6+ stops shipping a cp39 manylinux wheel, so on the
# 3.9 leg uv falls back to building from sdist. The build needs
# libbz2-dev + liblzma-dev system headers, which Ubuntu 24.04
# runners no longer pre-install. Run on every Linux leg so a
# future cp313/cp314 wheel drop doesn't break CI silently.
- name: Install Linux build deps for pyreadr sdist fallback
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libbz2-dev liblzma-dev
# xgboost on macOS dynamically links against libomp.dylib and
# apple-clang doesn't ship OpenMP. The macos-15 runner image
# stopped pre-installing libomp via Homebrew, so xgboost.core
# raises "OpenMP runtime is not installed" at import time.
- name: Install macOS runtime deps for xgboost (libomp)
if: runner.os == 'macOS'
run: brew install libomp
# `uv sync` against the committed lockfile installs:
# - the project (editable)
# - every [project.optional-dependencies] group (--all-extras)
# - every [dependency-groups] group (--all-groups)
# into a managed .venv. --frozen guarantees CI doesn't drift from
# the lockfile.
- name: Install project + extras + dep groups
run: uv sync --all-extras --all-groups --frozen --python ${{ matrix.python-version }}
- name: Run tests (live API tests included)
env:
# On by default for every trigger (push, PR, workflow_dispatch).
# The workflow_dispatch input can override with live_tests: "false"
# to skip live tests for a one-off run when upstream APIs are flaky.
SDV_PY_LIVE_TESTS: ${{ github.event.inputs.live_tests != 'false' && '1' || '' }}
run: uv run --frozen pytest --maxfail=10