[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.
This commit is contained in:
David Peter 2025-03-11 13:06:04 +01:00 committed by GitHub
parent 0af4985067
commit 3b497716f1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 \
# 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 ]
--debug > mypy_primer.diff || [ $? -eq 1 ]
# Output diff with ANSI color codes
cat mypy_primer.diff