[Build] Skip precompiled wheel fetch during metadata hooks (#51424)

Signed-off-by: mgoin <mgoin64@gmail.com>

Michael Goin committed Aug 10, 2026 at 12:38 UTC 3a749ce81600f67e609eeb4a9b2b8da52dac16f2
1 file changed +6 -2
setup.py
+6 -2
@@ -78,6 +78,10 @@ def has_precompiled_rust_extensions() -> bool:
78 return not get_missing_precompiled_rust_extension_modules()
79
80
81 +def is_metadata_only_build() -> bool:
82 + return bool({"egg_info", "dist_info"}.intersection(sys.argv[1:]))
83 +
84 +
85 if sys.platform.startswith("darwin") and VLLM_TARGET_DEVICE != "cpu":
86 logger.warning("VLLM_TARGET_DEVICE automatically set to `cpu` due to macOS")
87 VLLM_TARGET_DEVICE = "cpu"
@@ -1218,8 +1222,8 @@ def add_vllm_package_data(filename: str) -> None:
1222 vllm_files.append(filename)
1223
1224
1221 -# If using precompiled artifacts, extract and patch package_data in advance.
1222 -if USE_PRECOMPILED_RUST_FRONTEND:
1225 +# PEP 517 invokes setup.py for metadata before invoking the actual build.
1226 +if USE_PRECOMPILED_RUST_FRONTEND and not is_metadata_only_build():
1227 wheel_url, download_filename = precompiled_wheel_utils.determine_wheel_url()
1228 patch = precompiled_wheel_utils.extract_precompiled_and_patch_package(
1229 wheel_url,