diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml index 24f58f88361c8..c8039b90ca8f8 100644 --- a/.github/workflows/mypy.yaml +++ b/.github/workflows/mypy.yaml @@ -32,15 +32,4 @@ jobs: pip install types-setuptools - name: Mypy run: | - mypy - mypy tests --follow-imports skip - mypy vllm/attention --follow-imports skip - mypy vllm/distributed --follow-imports skip - mypy vllm/engine --follow-imports skip - mypy vllm/executor --follow-imports skip - mypy vllm/lora --follow-imports skip - mypy vllm/model_executor --follow-imports skip - mypy vllm/prompt_adapter --follow-imports skip - mypy vllm/spec_decode --follow-imports skip - mypy vllm/worker --follow-imports skip - + tools/mypy.sh diff --git a/format.sh b/format.sh index 1d785fcc16a61..1ac028d00e3a4 100755 --- a/format.sh +++ b/format.sh @@ -94,36 +94,9 @@ else fi echo 'vLLM yapf: Done' -run_mypy() { - echo "Running mypy on $1" - mypy --follow-imports skip "$@" -} - # Run mypy echo 'vLLM mypy:' -run_mypy # Note that this is less strict than CI -run_mypy tests -run_mypy vllm/assets -run_mypy vllm/attention -#run_mypy vllm/compilation -#run_mypy vllm/core -run_mypy vllm/distributed -run_mypy vllm/engine -#run_mypy vllm/entrypoints -run_mypy vllm/executor -#run_mypy vllm/inputs -run_mypy vllm/logging -run_mypy vllm/lora -run_mypy vllm/model_executor -run_mypy vllm/multimodal -run_mypy vllm/platforms -run_mypy vllm/plugins -run_mypy vllm/prompt_adapter -run_mypy vllm/spec_decode -run_mypy vllm/transformers_utils -run_mypy vllm/usage -#run_mypy vllm/vllm_flash_attn -run_mypy vllm/worker +tools/mypy.sh echo 'vLLM mypy: Done' diff --git a/tools/mypy.sh b/tools/mypy.sh new file mode 100755 index 0000000000000..4e358faafe8de --- /dev/null +++ b/tools/mypy.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +CI=${1:-0} + +run_mypy() { + echo "Running mypy on $1" + if [ $CI -eq 1 ] && [ -z "$1" ]; then + mypy "$@" + return + fi + mypy --follow-imports skip "$@" +} + +run_mypy # Note that this is less strict than CI +run_mypy tests +run_mypy vllm/assets +run_mypy vllm/attention +#run_mypy vllm/compilation +#run_mypy vllm/core +run_mypy vllm/distributed +run_mypy vllm/engine +#run_mypy vllm/entrypoints +run_mypy vllm/executor +#run_mypy vllm/inputs +run_mypy vllm/logging +run_mypy vllm/lora +run_mypy vllm/model_executor +run_mypy vllm/multimodal +run_mypy vllm/platforms +run_mypy vllm/plugins +run_mypy vllm/prompt_adapter +run_mypy vllm/spec_decode +run_mypy vllm/transformers_utils +run_mypy vllm/usage +#run_mypy vllm/vllm_flash_attn +run_mypy vllm/worker