From 3a749ce81600f67e609eeb4a9b2b8da52dac16f2 Mon Sep 17 00:00:00 2001 From: Michael Goin Date: Mon, 10 Aug 2026 12:38:53 -0400 Subject: [PATCH] [Build] Skip precompiled wheel fetch during metadata hooks (#51424) Signed-off-by: mgoin --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b88a4e8b52..1ddb3ea5d5 100644 --- a/setup.py +++ b/setup.py @@ -78,6 +78,10 @@ def has_precompiled_rust_extensions() -> bool: return not get_missing_precompiled_rust_extension_modules() +def is_metadata_only_build() -> bool: + return bool({"egg_info", "dist_info"}.intersection(sys.argv[1:])) + + if sys.platform.startswith("darwin") and VLLM_TARGET_DEVICE != "cpu": logger.warning("VLLM_TARGET_DEVICE automatically set to `cpu` due to macOS") VLLM_TARGET_DEVICE = "cpu" @@ -1218,8 +1222,8 @@ def add_vllm_package_data(filename: str) -> None: vllm_files.append(filename) -# If using precompiled artifacts, extract and patch package_data in advance. -if USE_PRECOMPILED_RUST_FRONTEND: +# PEP 517 invokes setup.py for metadata before invoking the actual build. +if USE_PRECOMPILED_RUST_FRONTEND and not is_metadata_only_build(): wheel_url, download_filename = precompiled_wheel_utils.determine_wheel_url() patch = precompiled_wheel_utils.extract_precompiled_and_patch_package( wheel_url,