[CI/Build] Improve mypy + python version matrix (#10041)
Signed-off-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
parent
6192e9b8fe
commit
e036e527a0
2
.github/workflows/mypy.yaml
vendored
2
.github/workflows/mypy.yaml
vendored
@ -43,4 +43,4 @@ jobs:
|
|||||||
- name: Mypy
|
- name: Mypy
|
||||||
run: |
|
run: |
|
||||||
echo "::add-matcher::.github/workflows/matchers/mypy.json"
|
echo "::add-matcher::.github/workflows/matchers/mypy.json"
|
||||||
tools/mypy.sh 1
|
tools/mypy.sh 1 ${{ matrix.python-version }}
|
||||||
|
@ -55,14 +55,12 @@ ignore = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
python_version = "3.9"
|
|
||||||
|
|
||||||
ignore_missing_imports = true
|
ignore_missing_imports = true
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
follow_imports = "silent"
|
follow_imports = "silent"
|
||||||
|
|
||||||
# After fixing type errors resulting from follow_imports: "skip" -> "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 = [
|
files = [
|
||||||
"vllm/*.py",
|
"vllm/*.py",
|
||||||
"vllm/adapter_commons",
|
"vllm/adapter_commons",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
CI=${1:-0}
|
CI=${1:-0}
|
||||||
|
PYTHON_VERSION=${2:-3.9}
|
||||||
|
|
||||||
if [ $CI -eq 1 ]; then
|
if [ $CI -eq 1 ]; then
|
||||||
set -e
|
set -e
|
||||||
@ -9,10 +10,10 @@ fi
|
|||||||
run_mypy() {
|
run_mypy() {
|
||||||
echo "Running mypy on $1"
|
echo "Running mypy on $1"
|
||||||
if [ $CI -eq 1 ] && [ -z "$1" ]; then
|
if [ $CI -eq 1 ] && [ -z "$1" ]; then
|
||||||
mypy "$@"
|
mypy --python-version "${PYTHON_VERSION}" "$@"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
mypy --follow-imports skip "$@"
|
mypy --follow-imports skip --python-version "${PYTHON_VERSION}" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
run_mypy # Note that this is less strict than CI
|
run_mypy # Note that this is less strict than CI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user