Patch-Source: https://github.com/archlinux/svntogit-community/blob/a7f15313fbf1bd4434b6b0a05cf87ec36047ed52/trunk/build-ac.index-in-tmp.diff --- a/backends/pep517.py 2022-10-26 23:06:36.402013172 +0800 +++ b/backends/pep517.py 2022-10-26 23:09:02.888234183 +0800 @@ -32,6 +32,7 @@ import tarfile import shutil import sys +import tempfile import zipfile from pathlib import Path @@ -205,12 +206,13 @@ def _build_and_inject_ac_index(build_dir, extracted_wheel_dir): - ac_index_build_name = _build_ac_index(build_dir) - print("Adding auto-complete index into wheel") - os.rename( - ac_index_build_name, - os.path.join(extracted_wheel_dir, AC_INDEX_REL_PATH), - ) + with tempfile.TemporaryDirectory() as ac_index_dir: + ac_index_build_name = _build_ac_index(ac_index_dir) + print("Adding auto-complete index into wheel") + shutil.copy2( + ac_index_build_name, + os.path.join(extracted_wheel_dir, AC_INDEX_REL_PATH), + ) def _build_ac_index(build_dir, rebuild=True):