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.
This commit is contained in:
Ashwin Bharambe 2025-10-31 07:12:22 -07:00
parent 51f3aeb479
commit d63e2e4060

View file

@ -165,8 +165,16 @@ jobs:
- name: Run mypy (full type checking) - name: Run mypy (full type checking)
run: | run: |
set +e set +e
$MYPY_CMD output=$($MYPY_CMD 2>&1)
status=$? 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 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'." echo "::error::Full mypy failed. Reproduce locally with 'uv run pre-commit run mypy-full --hook-stage manual --all-files'."
fi fi