Skip to content

Commit 16bc009

Browse files
henryiiiMusicalNinjaDad
authored andcommitted
fix: specify full path to non-venv Python (pypa#1881)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 8bc16f0 commit 16bc009

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cibuildwheel/macos.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def setup_python(
201201
dependency_constraint_flags: Sequence[PathOrStr],
202202
environment: ParsedEnvironment,
203203
build_frontend: BuildFrontendName,
204-
) -> dict[str, str]:
204+
) -> tuple[Path, dict[str, str]]:
205205
if build_frontend == "build[uv]" and Version(python_configuration.version) < Version("3.8"):
206206
build_frontend = "build"
207207

@@ -388,7 +388,7 @@ def setup_python(
388388
else:
389389
assert_never(build_frontend)
390390

391-
return env
391+
return base_python, env
392392

393393

394394
def build(options: Options, tmp_path: Path) -> None:
@@ -442,7 +442,7 @@ def build(options: Options, tmp_path: Path) -> None:
442442
build_options.dependency_constraints.get_for_python_version(config.version),
443443
]
444444

445-
env = setup_python(
445+
base_python, env = setup_python(
446446
identifier_tmp_dir / "build",
447447
config,
448448
dependency_constraint_flags,
@@ -658,7 +658,7 @@ def build(options: Options, tmp_path: Path) -> None:
658658

659659
if use_uv:
660660
pip_install = functools.partial(call, *pip, "install", *uv_arch_args)
661-
call("uv", "venv", venv_dir, "--python=python", env=env)
661+
call("uv", "venv", venv_dir, f"--python={base_python}", env=env)
662662
else:
663663
pip_install = functools.partial(call_with_arch, *pip, "install")
664664
# Use pip version from the initial env to ensure determinism

cibuildwheel/windows.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def setup_python(
233233
dependency_constraint_flags: Sequence[PathOrStr],
234234
environment: ParsedEnvironment,
235235
build_frontend: BuildFrontendName,
236-
) -> dict[str, str]:
236+
) -> tuple[Path, dict[str, str]]:
237237
tmp.mkdir()
238238
implementation_id = python_configuration.identifier.split("-")[0]
239239
python_libs_base = None
@@ -340,7 +340,7 @@ def setup_python(
340340
setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env)
341341
setup_rust_cross_compile(tmp, python_configuration, python_libs_base, env)
342342

343-
return env
343+
return base_python, env
344344

345345

346346
def build(options: Options, tmp_path: Path) -> None:
@@ -386,7 +386,7 @@ def build(options: Options, tmp_path: Path) -> None:
386386
]
387387

388388
# install Python
389-
env = setup_python(
389+
base_python, env = setup_python(
390390
identifier_tmp_dir / "build",
391391
config,
392392
dependency_constraint_flags,
@@ -512,7 +512,7 @@ def build(options: Options, tmp_path: Path) -> None:
512512
venv_dir = identifier_tmp_dir / "venv-test"
513513

514514
if use_uv:
515-
call("uv", "venv", venv_dir, "--python=python", env=env)
515+
call("uv", "venv", venv_dir, f"--python={base_python}", env=env)
516516
else:
517517
# Use pip version from the initial env to ensure determinism
518518
venv_args = ["--no-periodic-update", f"--pip={pip_version}"]

0 commit comments

Comments
 (0)