diff --git a/setup.py b/setup.py index 999abba2c79a0..9610c74f075e6 100644 --- a/setup.py +++ b/setup.py @@ -477,7 +477,11 @@ def get_vllm_version() -> str: write_to="vllm/_version.py", # TODO: move this to pyproject.toml ) - sep = "+" if "+" not in version else "." # dev versions might contain + + if "sdist" in sys.argv: + # skip local version specifiers for source distribution builds + return version + + sep = "+" if "+" not in version else "." # dev versions might already contain local version specifiers if _no_device(): if envs.VLLM_TARGET_DEVICE == "empty": @@ -489,9 +493,7 @@ def get_vllm_version() -> str: cuda_version = str(get_nvcc_cuda_version()) if cuda_version != MAIN_CUDA_VERSION: cuda_version_str = cuda_version.replace(".", "")[:3] - # skip this for source tarball, required for pypi - if "sdist" not in sys.argv: - version += f"{sep}cu{cuda_version_str}" + version += f"{sep}cu{cuda_version_str}" elif _is_hip(): import torch