From d63e2e406039dd461112f0caede04b3ce2612ce7 Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Fri, 31 Oct 2025 07:12:22 -0700 Subject: [PATCH] fix: skip mypy gracefully if not available on release branch The mypy check doesn't exist on release-0.3.x. Detect when mypy fails to spawn and treat it as a pass with a warning. --- .github/workflows/pre-commit.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 119567437..9749cbfb9 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -165,8 +165,16 @@ jobs: - name: Run mypy (full type checking) run: | set +e - $MYPY_CMD + output=$($MYPY_CMD 2>&1) status=$? + + # If mypy isn't available (common on older release branches), skip gracefully + if echo "$output" | grep -q "Failed to spawn.*mypy"; then + echo "::warning::mypy not available, skipping type checking (expected on release-0.3.x)" + exit 0 + fi + + echo "$output" if [ $status -ne 0 ]; then echo "::error::Full mypy failed. Reproduce locally with 'uv run pre-commit run mypy-full --hook-stage manual --all-files'." fi