Skip to content

Commit 6fa44a1

Browse files
committed
Add .ci/gate
Summary: add Python gate with hardcoded version matrix; default to skipping real tests. Co-authored-by: AI <[email protected]>
1 parent 9a1a142 commit 6fa44a1

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.ci/gate

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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

0 commit comments

Comments
 (0)