From 3b497716f1f2bbea74813a3ae5f33428fbbc9928 Mon Sep 17 00:00:00 2001 From: David Peter Date: Tue, 11 Mar 2025 13:06:04 +0100 Subject: [PATCH] [red-knot] mypy_primer: split installation and execution (#16622) ## Summary I noticed that the pipeline can succeed if there are problems with tool installation or dependency resolution. This change makes sure that the pipeline fails in these cases. --- .github/workflows/mypy_primer.yaml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/mypy_primer.yaml b/.github/workflows/mypy_primer.yaml index 3c2ec37b7f..4d9f903be1 100644 --- a/.github/workflows/mypy_primer.yaml +++ b/.github/workflows/mypy_primer.yaml @@ -43,6 +43,10 @@ jobs: - name: Install Rust toolchain run: rustup show + - name: Install mypy_primer + run: | + uv tool install "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" + - name: Run mypy_primer shell: bash run: | @@ -58,18 +62,15 @@ jobs: cd .. - echo "Running mypy_primer" - - ( - uvx --verbose --from "git+https://github.com/astral-sh/mypy_primer.git@add-red-knot-support" mypy_primer \ - --repo ruff \ - --type-checker knot \ - --old base_commit \ - --new "$GITHUB_SHA" \ - --project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \ - --output concise \ - --debug > mypy_primer.diff - ) || [ $? -eq 1 ] + # Allow the exit code to be 0 or 1, only fail for actual mypy_primer crashes/bugs + uvx mypy_primer \ + --repo ruff \ + --type-checker knot \ + --old base_commit \ + --new "$GITHUB_SHA" \ + --project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \ + --output concise \ + --debug > mypy_primer.diff || [ $? -eq 1 ] # Output diff with ANSI color codes cat mypy_primer.diff