Skip to content

[CI] Run mypy tests with a fixed Python version #14972

@srittau

Description

@srittau

Since mypy is currently considering to drop Python 3.9: We run most Python-based tasks in CI using a fixed Python version, even if we check against different versions, e.g.:

foo:
    strategy:
        matrix:
            python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
    steps:
    - uses: actions/setup-python@v6
      with:
          python-version: 3.13
    - run: bar --py ${{ matrix.python-version }}

The exception is mypy. I think this has mostly historical reason. I suggest we change this to always run mypy with a fixed version as well, and just use the --python-version flag. This removes a bit of churn for us, makes the Python versions used in the tests more consistent overall, and shouldn't have any adverse effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    project: infrastructuretypeshed build, test, documentation, or distribution related

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions