diff --git a/.buildkite/scripts/ci-bake-rocm.sh b/.buildkite/scripts/ci-bake-rocm.sh index 6c5f3308b7..0a9e6e7589 100644 --- a/.buildkite/scripts/ci-bake-rocm.sh +++ b/.buildkite/scripts/ci-bake-rocm.sh @@ -418,7 +418,7 @@ validate_ci_build_context_source() { describe_ci_revision() { git -C "$1" describe --tags --long --abbrev=10 \ - --match '*[0-9]*' "$2" 2>/dev/null + --match 'v[0-9]*' "$2" 2>/dev/null } write_ci_git_archival_metadata() { diff --git a/setup.py b/setup.py index b24bcc1a2c..ed9616195f 100644 --- a/setup.py +++ b/setup.py @@ -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: diff --git a/tools/build_rust.py b/tools/build_rust.py index a000ec8169..320cf75e3d 100644 --- a/tools/build_rust.py +++ b/tools/build_rust.py @@ -16,13 +16,28 @@ from setuptools_scm import get_version ROOT_DIR = Path(__file__).resolve().parents[1] VLLM_RS_BUILD_VERSION = "VLLM_RS_BUILD_VERSION" +# 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 prepare_build_environment() -> str | None: """Set the device-independent vLLM source version for Rust artifacts.""" version = os.getenv(VLLM_RS_BUILD_VERSION) or None if version is None: try: - version = get_version(root=ROOT_DIR) + version = get_version( + root=ROOT_DIR, + git_describe_command=VLLM_GIT_DESCRIBE_COMMAND, + ) except LookupError: return None