[Bugfix] Fix wrong vLLM version reported by pip install (proto-v* tag collision) (#57295)

Signed-off-by: RyanMa29 <ziyang.ma@intel.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: Bugen Zhao <i@bugenzhao.com>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Ziyang Ma
2026-09-17 08:50:14 -07:00
committed by GitHub
co-authored by Bugen Zhao Codex
parent 6a7de3ba3a
commit d7e755c230
3 changed files with 37 additions and 4 deletions
+20 -2
View File
@@ -22,6 +22,18 @@ from setuptools_rust.build import build_rust
from setuptools_scm import get_version
from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME
# Select vLLM release tags, excluding crate tags such as "proto-v0.3.0".
VLLM_GIT_DESCRIBE_COMMAND = [
"git",
"describe",
"--dirty",
"--tags",
"--long",
"--abbrev=40",
"--match",
"v[0-9]*",
]
def load_module_from_path(module_name, path):
spec = importlib.util.spec_from_file_location(module_name, path)
@@ -1249,9 +1261,15 @@ def get_vllm_version() -> str:
if env_version := os.getenv("VLLM_VERSION_OVERRIDE"):
print(f"Overriding VLLM version with {env_version} from VLLM_VERSION_OVERRIDE")
os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = env_version
return get_version(write_to="vllm/_version.py")
return get_version(
write_to="vllm/_version.py",
git_describe_command=VLLM_GIT_DESCRIBE_COMMAND,
)
version = get_version(write_to="vllm/_version.py")
version = get_version(
write_to="vllm/_version.py",
git_describe_command=VLLM_GIT_DESCRIBE_COMMAND,
)
sep = "+" if "+" not in version else "." # dev versions might contain +
if not envs.VLLM_SKIP_VERSION_SUFFIX: