Skip to content

Implement Manim 2D backend for CBFAnimator #158

Implement Manim 2D backend for CBFAnimator

Implement Manim 2D backend for CBFAnimator #158

Workflow file for this run

name: CI
on:
push:
branches: [ "main", "develop" ]
pull_request:
branches: [ "main", "develop" ]
jobs:
build:
runs-on: ubuntu-latest
env:
JAX_PLATFORM_NAME: cpu
UV_CACHE_DIR: /tmp/.uv-cache
JAX_COMPILATION_CACHE_DIR: /tmp/jax_cache
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Cache uv
uses: actions/cache@v5
with:
path: /tmp/.uv-cache
key: ${{ runner.os }}-uv-${{ hashFiles('uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Cache JAX compilation
uses: actions/cache@v5
with:
path: /tmp/jax_cache
key: ${{ runner.os }}-jax-${{ github.sha }}
restore-keys: |
${{ runner.os }}-jax-
- name: Install dependencies
env:
UV_SYSTEM_PYTHON: 1
run: |
pip install uv
if [ "${{ matrix.python-version }}" == "3.10" ]; then
uv pip install -e ".[dev]" ruff mypy
else
uv pip install -e ".[dev]"
fi
- name: Lint with ruff
if: matrix.python-version == '3.10'
env:
UV_SYSTEM_PYTHON: 1
run: |
ruff check src
- name: Type check with mypy
if: matrix.python-version == '3.10'
env:
UV_SYSTEM_PYTHON: 1
run: |
mypy src/cbfkit || true
- name: Test with pytest
run: |
pytest -m "not slow" tests
- name: Test slow tests
if: matrix.python-version == '3.10'
env:
CBFKIT_TEST_MODE: "1"
run: |
pytest -m "slow" tests
core-import:
name: Slim-core import (no extras)
runs-on: ubuntu-latest
env:
JAX_PLATFORM_NAME: cpu
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install core only (no extras)
run: pip install .
- name: Assert the default import surface stays lean
run: |
python - <<'PY'
import sys
import cbfkit
from cbfkit.controllers.cbf_clf import vanilla_cbf_clf_qp_controller
from cbfkit.optimization.quadratic_program import get_solver
get_solver("fast")
get_solver("jaxopt")
heavy = {"casadi", "cvxopt", "kvxopt", "plotly"}
leaked = sorted(m for m in sys.modules if m.split(".")[0] in heavy)
assert not leaked, f"Heavy optional deps leaked into the default import: {leaked}"
print("OK: default import surface is lean (no casadi/cvxopt/plotly).")
PY