Skip to content

[CI] Remove hack to run mypy for Python 3.14 #14183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ jobs:
strategy:
matrix:
platform: ["linux", "win32", "darwin"]
# TODO (2025-05-10) "3.13.2" should be "3.14-dev", see below.
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13.2"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14-dev"]
fail-fast: false
steps:
- uses: actions/checkout@v4
Expand All @@ -81,15 +80,9 @@ jobs:
fi
- name: Run mypy_test.py
run: |
# TODO: (2025-05-10) This is a bad hack to work around mypy crashing
# when running on Python 3.14. See https://github.com/python/mypy/pull/19020.
if [[ "${{ matrix.python-version }}" == "3.13.2" ]]; then
MYPY_PY_VERSION="3.14"
else
# 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)
fi
# 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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#allow-pre-releases this wouldn't be needed. Do you see a reason not to use it?

python ./tests/mypy_test.py --platform=${{ matrix.platform }} --python-version=${MYPY_PY_VERSION}

regression-tests:
Expand Down