From d9d45f3a7977dcb83bf5bad581502a7ee08b32bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20De=20Revi=C3=A8re?= Date: Thu, 29 Jan 2026 20:41:37 +0100 Subject: [PATCH] Add `.ci/gate` Summary: add Python gate with hardcoded version matrix; default to skipping real tests. Co-authored-by: AI --- .ci/gate | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 .ci/gate diff --git a/.ci/gate b/.ci/gate new file mode 100755 index 0000000..c785e9e --- /dev/null +++ b/.ci/gate @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Local CI for Python projects. +# - Default skips live/real tests. +# - Opt in with: GATE_REAL=1 gate +# - Or pass custom args: GATE_PYTEST_ARGS='-m real' gate + +uvx ruff format --check . +uvx ruff check . + +py_versions=(3.10 3.11 3.12 3.13 3.14) + +pytest_args=() +if [ "${GATE_REAL:-}" != "1" ] && [ "${GATE_REAL:-}" != "true" ]; then + pytest_args+=("-m" "not real") +fi +if [ -n "${GATE_PYTEST_ARGS:-}" ]; then + read -r -a extra_args <<<"${GATE_PYTEST_ARGS}" + pytest_args+=("${extra_args[@]}") +fi + +if [ -d "tests" ]; then + for py in "${py_versions[@]}"; do + echo "Testing with Python $py..." + uv run --python "$py" --group dev -- pytest -q tests/ "${pytest_args[@]}" + done +else + echo "Warning: no tests/ directory; skipping pytest" >&2 +fi