From 53251c71840bda29c9b9867edfb88f85ed8c1a06 Mon Sep 17 00:00:00 2001 From: Sebastian Brodehl Date: Sun, 14 Nov 2021 16:19:57 +0100 Subject: [PATCH] fix: add python3.exe symlink on windows (#917) * Add python3.exe symlink. * Check if python3.exe already exists and print debug info. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Raise error. * Remove error raise and debug output. * Add comment to symlink creation. Co-authored-by: Henry Schreiner Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner --- cibuildwheel/windows.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cibuildwheel/windows.py b/cibuildwheel/windows.py index 0a429c6d..2552a961 100644 --- a/cibuildwheel/windows.py +++ b/cibuildwheel/windows.py @@ -97,6 +97,10 @@ def install_cpython(version: str, arch: str, nuget: Path) -> Path: nuget_args = get_nuget_args(version, arch) installation_path = Path(nuget_args[-1]) / (nuget_args[0] + "." + version) / "tools" call([nuget, "install", *nuget_args]) + # "python3" is not included in the vanilla nuget package, + # though it can be present if modified (like on Azure). + if not (installation_path / "python3.exe").exists(): + (installation_path / "python3.exe").symlink_to(installation_path / "python.exe") return installation_path