From 168af67fb89463dffb736f4d5a12b81a842a686e Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Fri, 9 May 2025 20:26:53 +0200 Subject: [PATCH] [CI] Fix "mypy: Check stubs" when using specific Python version (#13975) --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e9ef6b394..c2078c4b6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,7 +70,11 @@ jobs: python-version: ${{ matrix.python-version }} - run: curl -LsSf https://astral.sh/uv/install.sh | sh - run: uv pip install -r requirements-tests.txt --system - - run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }} + - run: | + # python-version can sometimes be pinned to a specific version or to "-dev", but + # mypy understands only X.Y version numbers. + MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2) + python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION} regression-tests: name: "mypy: Run test cases"