2023-05-15 10:49:28 +02:00
|
|
|
# Workflow to run mypy on select parts of the CPython repo
|
|
|
|
name: mypy
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-09-19 07:49:26 +02:00
|
|
|
- ".github/workflows/mypy.yml"
|
2024-05-05 21:32:23 +02:00
|
|
|
- "Lib/_pyrepl/**"
|
2023-12-01 00:00:14 +01:00
|
|
|
- "Lib/test/libregrtest/**"
|
2023-12-07 17:01:58 +01:00
|
|
|
- "Tools/build/generate_sbom.py"
|
2023-08-18 15:42:45 +02:00
|
|
|
- "Tools/cases_generator/**"
|
2023-09-19 07:49:26 +02:00
|
|
|
- "Tools/clinic/**"
|
2024-01-29 03:48:48 +01:00
|
|
|
- "Tools/jit/**"
|
2023-08-28 22:04:12 +02:00
|
|
|
- "Tools/peg_generator/**"
|
2023-08-25 00:05:23 +02:00
|
|
|
- "Tools/requirements-dev.txt"
|
2023-09-19 07:49:26 +02:00
|
|
|
- "Tools/wasm/**"
|
2023-05-15 10:49:28 +02: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 15:42:45 +02:00
|
|
|
strategy:
|
2024-05-21 13:52:43 +02:00
|
|
|
fail-fast: false
|
2023-08-18 15:42:45 +02:00
|
|
|
matrix:
|
2023-08-28 22:04:12 +02:00
|
|
|
target: [
|
2024-05-05 21:32:23 +02:00
|
|
|
"Lib/_pyrepl",
|
2023-12-01 00:00:14 +01:00
|
|
|
"Lib/test/libregrtest",
|
2024-05-05 21:32:23 +02:00
|
|
|
"Tools/build",
|
2023-08-28 22:04:12 +02:00
|
|
|
"Tools/cases_generator",
|
|
|
|
"Tools/clinic",
|
2024-01-29 03:48:48 +01:00
|
|
|
"Tools/jit",
|
2023-08-28 22:04:12 +02:00
|
|
|
"Tools/peg_generator",
|
2023-09-19 07:49:26 +02:00
|
|
|
"Tools/wasm",
|
2023-08-28 22:04:12 +02:00
|
|
|
]
|
2023-08-18 15:42:45 +02:00
|
|
|
name: Run mypy on ${{ matrix.target }}
|
2023-05-15 10:49:28 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
2023-09-04 22:36:16 +02:00
|
|
|
- uses: actions/checkout@v4
|
2024-01-01 10:25:58 +01:00
|
|
|
- uses: actions/setup-python@v5
|
2023-05-15 10:49:28 +02:00
|
|
|
with:
|
2024-10-16 16:27:19 +02:00
|
|
|
python-version: "3.13"
|
2023-05-15 10:49:28 +02:00
|
|
|
cache: pip
|
2023-08-18 15:42:45 +02:00
|
|
|
cache-dependency-path: Tools/requirements-dev.txt
|
|
|
|
- run: pip install -r Tools/requirements-dev.txt
|
|
|
|
- run: mypy --config-file ${{ matrix.target }}/mypy.ini
|