[CI/Build] Improve mypy + python version matrix (#10041)

Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Russell Bryant 2024-11-07 02:54:16 -05:00 committed by GitHub
parent 6192e9b8fe
commit e036e527a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 6 deletions

View File

@ -43,4 +43,4 @@ jobs:
- name: Mypy
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
tools/mypy.sh 1
tools/mypy.sh 1 ${{ matrix.python-version }}

View File

@ -55,14 +55,12 @@ ignore = [
]
[tool.mypy]
python_version = "3.9"
ignore_missing_imports = true
check_untyped_defs = true
follow_imports = "silent"
# After fixing type errors resulting from follow_imports: "skip" -> "silent",
# move the directory here and remove it from format.sh and mypy.yaml
# move the directory here and remove it from tools/mypy.sh
files = [
"vllm/*.py",
"vllm/adapter_commons",

View File

@ -1,6 +1,7 @@
#!/bin/bash
CI=${1:-0}
PYTHON_VERSION=${2:-3.9}
if [ $CI -eq 1 ]; then
set -e
@ -9,10 +10,10 @@ fi
run_mypy() {
echo "Running mypy on $1"
if [ $CI -eq 1 ] && [ -z "$1" ]; then
mypy "$@"
mypy --python-version "${PYTHON_VERSION}" "$@"
return
fi
mypy --follow-imports skip "$@"
mypy --follow-imports skip --python-version "${PYTHON_VERSION}" "$@"
}
run_mypy # Note that this is less strict than CI