2023-05-15 05:49:28 -03:00
|
|
|
# Workflow to run mypy on select parts of the CPython repo
|
|
|
|
name: mypy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-09-19 02:49:26 -03:00
|
|
|
- ".github/workflows/mypy.yml"
|
2024-05-05 16:32:23 -03:00
|
|
|
- "Lib/_pyrepl/**"
|
2023-11-30 19:00:14 -04:00
|
|
|
- "Lib/test/libregrtest/**"
|
2023-12-07 12:01:58 -04:00
|
|
|
- "Tools/build/generate_sbom.py"
|
2023-08-18 10:42:45 -03:00
|
|
|
- "Tools/cases_generator/**"
|
2023-09-19 02:49:26 -03:00
|
|
|
- "Tools/clinic/**"
|
2024-01-28 22:48:48 -04:00
|
|
|
- "Tools/jit/**"
|
2023-08-28 17:04:12 -03:00
|
|
|
- "Tools/peg_generator/**"
|
2023-08-24 19:05:23 -03:00
|
|
|
- "Tools/requirements-dev.txt"
|
2023-09-19 02:49:26 -03:00
|
|
|
- "Tools/wasm/**"
|
2023-05-15 05:49:28 -03:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
env:
|
|
|
|
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
|
|
|
FORCE_COLOR: 1
|
|
|
|
TERM: xterm-256color # needed for FORCE_COLOR to work on mypy on Ubuntu, see https://github.com/python/mypy/issues/13817
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
mypy:
|
2023-08-18 10:42:45 -03:00
|
|
|
strategy:
|
2024-05-21 08:52:43 -03:00
|
|
|
fail-fast: false
|
2023-08-18 10:42:45 -03:00
|
|
|
matrix:
|
2023-08-28 17:04:12 -03:00
|
|
|
target: [
|
2024-05-05 16:32:23 -03:00
|
|
|
"Lib/_pyrepl",
|
2023-11-30 19:00:14 -04:00
|
|
|
"Lib/test/libregrtest",
|
2024-05-05 16:32:23 -03:00
|
|
|
"Tools/build",
|
2023-08-28 17:04:12 -03:00
|
|
|
"Tools/cases_generator",
|
|
|
|
"Tools/clinic",
|
2024-01-28 22:48:48 -04:00
|
|
|
"Tools/jit",
|
2023-08-28 17:04:12 -03:00
|
|
|
"Tools/peg_generator",
|
2023-09-19 02:49:26 -03:00
|
|
|
"Tools/wasm",
|
2023-08-28 17:04:12 -03:00
|
|
|
]
|
2023-08-18 10:42:45 -03:00
|
|
|
name: Run mypy on ${{ matrix.target }}
|
2023-05-15 05:49:28 -03:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
2023-09-04 17:36:16 -03:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-01 05:25:58 -04:00
|
|
|
- uses: actions/setup-python@v5
|
2023-05-15 05:49:28 -03:00
|
|
|
with:
|
2023-08-18 10:42:45 -03:00
|
|
|
python-version: "3.11"
|
2023-05-15 05:49:28 -03:00
|
|
|
cache: pip
|
2023-08-18 10:42:45 -03:00
|
|
|
cache-dependency-path: Tools/requirements-dev.txt
|
|
|
|
- run: pip install -r Tools/requirements-dev.txt
|
|
|
|
- run: mypy --config-file ${{ matrix.target }}/mypy.ini
|