🚀 The feature, motivation and pitch
Thanks for the context from @hmellor !
A following up issue for #26448
Now in vllm-source/tools/pre_commit/mypy.py, several directories are checked with mypy in isolation with import following skipped:
SEPARATE_GROUPS = [
"tests",
# v0 related
"vllm/attention",
"vllm/compilation",
"vllm/engine",
"vllm/inputs",
"vllm/lora",
"vllm/model_executor",
"vllm/plugins",
"vllm/worker",
# v1 related
"vllm/v1/attention",
"vllm/v1/executor",
"vllm/v1/kv_offload",
"vllm/v1/metrics",
"vllm/v1/pool",
"vllm/v1/sample",
"vllm/v1/spec_decode",
"vllm/v1/structured_output",
]
V0 related is not that important since we will deprecate all of them soon, but v1 is strongly needed.
This won't break pre-commit CI because all the files in each directory are checked, so no imports need following. However, if you only edit one file locally, the pre-commit check will only run on that file and the imports will not be followed. This may cause the pre-commit check to fail locally.
We can gradually fix all of the SEPARATE_GROUPS to FILES to solve the issue throughly
Instructions
Move code like "vllm/v1/executor" from SEPARATE_GROUPS to FILES
diff --git a/tools/pre_commit/mypy.py b/tools/pre_commit/mypy.py
index 8d04848f8..68d8214ad 100755
--- a/tools/pre_commit/mypy.py
+++ b/tools/pre_commit/mypy.py
@@ -38,6 +38,8 @@ FILES = [
"vllm/usage",
"vllm/v1/core",
"vllm/v1/engine",
+ "vllm/v1/attention",
+ "vllm/v1/executor",
]
# After fixing errors resulting from changing follow_imports
@@ -54,8 +56,7 @@ SEPARATE_GROUPS = [
"vllm/plugins",
"vllm/worker",
# v1 related
- "vllm/v1/attention",
- "vllm/v1/executor",
+
"vllm/v1/kv_offload",
"vllm/v1/metrics",
"vllm/v1/pool",
Then run the command pre-commit run --hook-stage manual mypy-3.13 -a, you will see a lot of errors, and fix the error locally.
Pull requests:
🚀 The feature, motivation and pitch
Thanks for the context from @hmellor !
A following up issue for #26448
Now in
vllm-source/tools/pre_commit/mypy.py, several directories are checked withmypyin isolation with import following skipped:SEPARATE_GROUPS = [ "tests", # v0 related "vllm/attention", "vllm/compilation", "vllm/engine", "vllm/inputs", "vllm/lora", "vllm/model_executor", "vllm/plugins", "vllm/worker", # v1 related "vllm/v1/attention", "vllm/v1/executor", "vllm/v1/kv_offload", "vllm/v1/metrics", "vllm/v1/pool", "vllm/v1/sample", "vllm/v1/spec_decode", "vllm/v1/structured_output", ]V0 related is not that important since we will deprecate all of them soon, but v1 is strongly needed.
This won't break pre-commit CI because all the files in each directory are checked, so no imports need following. However, if you only edit one file locally, the
pre-commitcheck will only run on that file and the imports will not be followed. This may cause the pre-commit check to fail locally.We can gradually fix all of the
SEPARATE_GROUPStoFILESto solve the issue throughlyInstructions
Move code like
"vllm/v1/executor"fromSEPARATE_GROUPStoFILESdiff --git a/tools/pre_commit/mypy.py b/tools/pre_commit/mypy.py index 8d04848f8..68d8214ad 100755 --- a/tools/pre_commit/mypy.py +++ b/tools/pre_commit/mypy.py @@ -38,6 +38,8 @@ FILES = [ "vllm/usage", "vllm/v1/core", "vllm/v1/engine", + "vllm/v1/attention", + "vllm/v1/executor", ] # After fixing errors resulting from changing follow_imports @@ -54,8 +56,7 @@ SEPARATE_GROUPS = [ "vllm/plugins", "vllm/worker", # v1 related - "vllm/v1/attention", - "vllm/v1/executor", + "vllm/v1/kv_offload", "vllm/v1/metrics", "vllm/v1/pool",Then run the command
pre-commit run --hook-stage manual mypy-3.13 -a, you will see a lot of errors, and fix the error locally.Pull requests:
vllm/compilation#33199vllm/lora#30874vllm/distributed#26593vllm/executor#26845vllm/v1/coreandvllm/v1/engine#27108vllm/v1/worker#29037vllm/utilsandvllm/v1/pool#29666vllm/v1/structured_output#32722vllm/spec_decode#33282vllm/config#37808vllm/v1/ops#39219