Skip to content

Commit 168af67

Browse files
authored
[CI] Fix "mypy: Check stubs" when using specific Python version (python#13975)
1 parent 6e2525a commit 168af67

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ jobs:
7070
python-version: ${{ matrix.python-version }}
7171
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
7272
- run: uv pip install -r requirements-tests.txt --system
73-
- run: python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${{ matrix.python-version }}
73+
- run: |
74+
# python-version can sometimes be pinned to a specific version or to "-dev", but
75+
# mypy understands only X.Y version numbers.
76+
MYPY_PY_VERSION=$(echo ${{ matrix.python-version }} | cut -d - -f 1 | cut -d . -f 1-2)
77+
python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION}
7478
7579
regression-tests:
7680
name: "mypy: Run test cases"

0 commit comments

Comments
 (0)