File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ # Local CI for Python projects.
5+ # - Default skips live/real tests.
6+ # - Opt in with: GATE_REAL=1 gate
7+ # - Or pass custom args: GATE_PYTEST_ARGS='-m real' gate
8+
9+ uvx ruff format --check .
10+ uvx ruff check .
11+
12+ py_versions=(3.10 3.11 3.12 3.13 3.14)
13+
14+ pytest_args=()
15+ if [ " ${GATE_REAL:- } " != " 1" ] && [ " ${GATE_REAL:- } " != " true" ]; then
16+ pytest_args+=(" -m" " not real" )
17+ fi
18+ if [ -n " ${GATE_PYTEST_ARGS:- } " ]; then
19+ read -r -a extra_args <<< " ${GATE_PYTEST_ARGS}"
20+ pytest_args+=(" ${extra_args[@]} " )
21+ fi
22+
23+ if [ -d " tests" ]; then
24+ for py in " ${py_versions[@]} " ; do
25+ echo " Testing with Python $py ..."
26+ uv run --python " $py " --group dev -- pytest -q tests/ " ${pytest_args[@]} "
27+ done
28+ else
29+ echo " Warning: no tests/ directory; skipping pytest" >&2
30+ fi
You can’t perform that action at this time.
0 commit comments