From 2467b642dd9bde32a334fe5967efd78a53aa49da Mon Sep 17 00:00:00 2001 From: Daniele <36171005+dtrifiro@users.noreply.github.com> Date: Tue, 24 Sep 2024 21:38:12 +0200 Subject: [PATCH] [CI/Build] fix setuptools-scm usage (#8771) --- .gitignore | 7 ++----- pyproject.toml | 3 --- setup.py | 7 +++++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 43eb89cacc0a5..abeaf0a82e303 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -# vllm commit id, generated by setup.py -vllm/commit_id.py +# version file generated by setuptools-scm +/vllm/_version.py # vllm-flash-attn built from source vllm/vllm_flash_attn/ @@ -196,8 +196,5 @@ _build/ *_hip* hip_compat.h -# version file generated by setuptools-scm -/vllm/_version.py - # Benchmark dataset benchmarks/*.json diff --git a/pyproject.toml b/pyproject.toml index 4e1841484420a..c9057b061aad9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -51,9 +51,6 @@ ignore = [ "UP032", ] -[tool.setuptools_scm] -version_file = "vllm/_version.py" - [tool.mypy] python_version = "3.8" diff --git a/setup.py b/setup.py index 85a2852136eaa..8ef759f5245fc 100644 --- a/setup.py +++ b/setup.py @@ -354,12 +354,15 @@ def get_path(*filepath) -> str: def get_vllm_version() -> str: - version = get_version() + version = get_version( + write_to="vllm/_version.py", # TODO: move this to pyproject.toml + ) + sep = "+" if "+" not in version else "." # dev versions might contain + if _no_device(): if envs.VLLM_TARGET_DEVICE == "empty": - version += "+empty" + version += f"{sep}empty" elif _is_cuda(): cuda_version = str(get_nvcc_cuda_version()) if cuda_version != MAIN_CUDA_VERSION: