diff --git a/setup.py b/setup.py index ed4b88364a6d..671ec7739918 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 import ctypes +import glob import importlib.util import json import logging @@ -8,6 +9,7 @@ import re import subprocess import sys +import zipfile from pathlib import Path from shutil import which @@ -271,12 +273,14 @@ def run(self): # copy vllm/vllm_flash_attn/*.py from self.build_lib to current # directory so that they can be included in the editable build - import glob + # but ignore __init__.py files files = glob.glob( os.path.join(self.build_lib, "vllm", "vllm_flash_attn", "*.py")) for file in files: - dst_file = os.path.join("vllm/vllm_flash_attn", - os.path.basename(file)) + # Skip __init__.py files + if (basename := os.path.basename(file)) == "__init__.py": + continue + dst_file = os.path.join("vllm/vllm_flash_attn", basename) print(f"Copying {file} to {dst_file}") self.copy_file(file, dst_file) @@ -342,8 +346,6 @@ def run(self) -> None: if not is_url_available(wheel_location): wheel_location = "https://wheels.vllm.ai/nightly/vllm-1.0.0.dev-cp38-abi3-manylinux1_x86_64.whl" - import zipfile - if os.path.isfile(wheel_location): wheel_path = wheel_location print(f"Using existing wheel={wheel_path}")