diff --git a/cibuildwheel/macos.py b/cibuildwheel/macos.py index fcc88dac9..0a5d91bb8 100644 --- a/cibuildwheel/macos.py +++ b/cibuildwheel/macos.py @@ -139,7 +139,7 @@ def get_python_configurations( return python_configurations -def install_cpython(tmp: Path, version: str, url: str, free_threading: bool) -> Path: +def install_cpython(_tmp: Path, version: str, url: str, free_threading: bool) -> Path: ft = "T" if free_threading else "" installation_path = Path(f"/Library/Frameworks/Python{ft}.framework/Versions/{version}") with FileLock(CIBW_CACHE_PATH / f"cpython{version}.lock"): @@ -161,10 +161,10 @@ def install_cpython(tmp: Path, version: str, url: str, free_threading: bool) -> """ ) raise errors.FatalError(msg) - pkg_path = tmp / "Python.pkg" - # download the pkg - download(url, pkg_path) - # install + python_filename = url.split("/")[-1] + pkg_path = CIBW_CACHE_PATH / "cpython-installer" / python_filename + if not pkg_path.exists(): + download(url, pkg_path) args = [] if version.startswith("3.13"): # Python 3.13 is the first version to have a free-threading option