Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cibuildwheel/platforms/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def setup_python(
"pip",
"install",
"--upgrade",
"build[virtualenv]",
"build[virtualenv, uv]",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will install another copy of there is already an external one. I think we try to avoid that everywhere else.

Copy link
Member Author

@mayeut mayeut Dec 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will install another copy of there is already an external one.

Yes indeed, hope it's clear enough in the PR description.

I think we try to avoid that everywhere else.

macOS is already doing that.

I'm wondering if the uv extra is not just plain broken when the virtual environment is not activated.
I'll try something else in a following commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2691 opened as an alternative

*constraint_flags(dependency_constraint),
env=env,
)
Expand Down Expand Up @@ -575,7 +575,12 @@ def build(options: Options, tmp_path: Path) -> None:
)
shell(before_test_prepared, env=virtualenv_env)

pip = ["uv", "pip"] if use_uv else ["pip"]
if use_uv:
uv_path = find_uv()
assert uv_path is not None
pip = [str(uv_path), "pip"]
else:
pip = ["pip"]

# install the wheel
call(
Expand Down
6 changes: 5 additions & 1 deletion cibuildwheel/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def virtualenv(
assert python.exists()

if use_uv:
call("uv", "venv", venv_path, "--python", python)
uv_path = find_uv()
if uv_path is None:
msg = "Could not find 'uv' executable."
raise FileNotFoundError(msg)
call(uv_path, "venv", venv_path, "--python", python)
else:
virtualenv_app, virtualenv_version = _ensure_virtualenv(version)
if pip_version is None:
Expand Down
Loading