From ccc246d240ba2198f31e03479202d2407726dfdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Trifir=C3=B2?= Date: Tue, 21 Jan 2025 14:51:14 +0100 Subject: [PATCH] setup.py: fix sdist builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniele Trifirò --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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