diff --git a/python/setup.py b/python/setup.py index b618737ff800..248d69633895 100644 --- a/python/setup.py +++ b/python/setup.py @@ -86,17 +86,19 @@ def get_thirdparty_packages(triton_cache_path): if p.syspath_var_name in os.environ: package_dir = os.environ[p.syspath_var_name] test_file_path = os.path.join(package_dir, p.test_file) - print(f"Skipping download and extract of {p.url}") -# if not os.path.exists(test_file_path): -# try: -# shutil.rmtree(package_root_dir) -# except Exception: -# pass -# os.makedirs(package_root_dir, exist_ok=True) -# print(f'downloading and extracting {p.url} for {p.name} ...') -# ftpstream = urllib.request.urlopen(p.url) -# file = tarfile.open(fileobj=ftpstream, mode="r|*") -# file.extractall(path=package_root_dir) + if p.name == "llvm": + print(f"Skipping download and extract of {p.url}") + else: + if not os.path.exists(test_file_path): + try: + shutil.rmtree(package_root_dir) + except Exception: + pass + os.makedirs(package_root_dir, exist_ok=True) + print(f'downloading and extracting {p.url} for {p.name} ...') + ftpstream = urllib.request.urlopen(p.url) + file = tarfile.open(fileobj=ftpstream, mode="r|*") + file.extractall(path=package_root_dir) if p.include_flag: thirdparty_cmake_args.append(f"-D{p.include_flag}={package_dir}/include") if p.lib_flag: