mypy.sh 795 Bytes
Newer Older
1
2
3
#!/bin/bash

CI=${1:-0}
4
PYTHON_VERSION=${2:-local}
5

6
if [ "$CI" -eq 1 ]; then
7
8
9
    set -e
fi

10
11
12
13
if [ $PYTHON_VERSION == "local" ]; then
    PYTHON_VERSION=$(python -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
fi

14
15
run_mypy() {
    echo "Running mypy on $1"
16
    if [ "$CI" -eq 1 ] && [ -z "$1" ]; then
17
        mypy --python-version "${PYTHON_VERSION}" "$@"
18
19
        return
    fi
20
    mypy --follow-imports skip --python-version "${PYTHON_VERSION}" "$@"
21
22
23
24
25
}

run_mypy # Note that this is less strict than CI
run_mypy tests
run_mypy vllm/attention
26
run_mypy vllm/compilation
27
28
29
run_mypy vllm/distributed
run_mypy vllm/engine
run_mypy vllm/executor
30
run_mypy vllm/inputs
31
32
33
34
run_mypy vllm/lora
run_mypy vllm/model_executor
run_mypy vllm/plugins
run_mypy vllm/worker
35
run_mypy vllm/v1