Skip to content

Commit

Permalink
Update mypy and run it on all the files
Browse files Browse the repository at this point in the history
Running `mypy` only on the changed files is the wrong thing to do, as typing changes in one file can have an effect on upstream code that imports said file.

Apart from removing that file filtering, this also updates the `setup-python` GHA, and `mypy` itself.
  • Loading branch information
Swatinem committed Nov 18, 2024
1 parent 0584651 commit 8d3fe38
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ on:
extra_config:
type: string
required: false
default: ''
description: 'Extra configuration for mypy'
default: ""
description: "Extra configuration for mypy"

jobs:
static-type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: '3.12'
- run: pip install mypy==1.10.0
- name: Get Python changed files
id: changed-py-files
uses: tj-actions/[email protected]
with:
files: |
*.py
**/*.py
- name: Run if any of the listed files above is changed
if: steps.changed-py-files.outputs.any_changed == 'true'
run: mypy ${{ steps.changed-py-files.outputs.all_changed_files }} --ignore-missing-imports ${{ inputs.extra_config }}
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install mypy==1.13.0
- run: mypy . --ignore-missing-imports ${{ inputs.extra_config }}

0 comments on commit 8d3fe38

Please sign in to comment.