Skip to content

Commit 70fb1c4

Browse files
authored
fix: specify full path to non-venv Python (#1881)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 405a475 commit 70fb1c4

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
@@ -223,7 +223,7 @@ def setup_python(
223223
dependency_constraint_flags: Sequence[PathOrStr],
224224
environment: ParsedEnvironment,
225225
build_frontend: BuildFrontendName,
226-
) -> dict[str, str]:
226+
) -> tuple[Path, dict[str, str]]:
227227
tmp.mkdir()
228228
implementation_id = python_configuration.identifier.split("-")[0]
229229
python_libs_base = None
@@ -330,7 +330,7 @@ def setup_python(
330330
setup_setuptools_cross_compile(tmp, python_configuration, python_libs_base, env)
331331
setup_rust_cross_compile(tmp, python_configuration, python_libs_base, env)
332332

333-
return env
333+
return base_python, env
334334

335335

336336
def build(options: Options, tmp_path: Path) -> None:
@@ -376,7 +376,7 @@ def build(options: Options, tmp_path: Path) -> None:
376376
]
377377

378378
# install Python
379-
env = setup_python(
379+
base_python, env = setup_python(
380380
identifier_tmp_dir / "build",
381381
config,
382382
dependency_constraint_flags,
@@ -502,7 +502,7 @@ def build(options: Options, tmp_path: Path) -> None:
502502
venv_dir = identifier_tmp_dir / "venv-test"
503503

504504
if use_uv:
505-
call("uv", "venv", venv_dir, "--python=python", env=env)
505+
call("uv", "venv", venv_dir, f"--python={base_python}", env=env)
506506
else:
507507
# Use pip version from the initial env to ensure determinism
508508
venv_args = ["--no-periodic-update", f"--pip={pip_version}"]

0 commit comments

Comments
 (0)