Skip to content

Conversation

@joerick
Copy link
Contributor

@joerick joerick commented Dec 19, 2025

Don't get clever about it at all, instead make uv on PATH a hard requirement for the caller of the cibuildwheel CLI. See #2691 (comment) for context.

In the github action, this approach does add the cibuildwheel install venv bin to PATH. This has the potential downside of exposing some other transitive deps of cibuildwheel, but I think that's a theoretical downside, I'm not aware of a way that could be an issue in practice. I think it's an okay tradeoff for more simplicity.

close #2690
close #2673
close #2691

Don't get clever about it at all, instead make uv on PATH a hard
requirement.
@joerick joerick requested a review from mhsmith as a code owner December 19, 2025 17:28
@henryiii
Copy link
Contributor

I'm back now, I'll try to take a look soon, I would like for all of the packages I work on that can use uv (build, nox, cibuildwheel, check-sdist) to do exactly the same behavior (I think this is also true for tox and others). If the problem is that we are not setting up our fake virtual environment correctly, then we should fix that.

I can get a build release out soon to see if that helps, as well.

@joerick
Copy link
Contributor Author

joerick commented Dec 24, 2025

Thanks. Yeah, just a thought- it's kinda hard for the build behaviour to always match cibuildwheel, because build doesn't expose uv to its target venv, but cibuildwheel does.

Python packages don't inherit between venvs. But PATH entries do. So that's some of the logic behind this approach.

@joerick
Copy link
Contributor Author

joerick commented Jan 4, 2026

By the way, I have a theory why #2630 broke some builders e.g. meson-python in #2663.

In the version on main, the PATH variable is being extended in a bash step.

cibuildwheel/action.yml

Lines 89 to 91 in 24bade1

full_path = f"{clean_bin_path}{os.pathsep}{os.environ['PATH']}"
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"updated-path={full_path}\n")

And the PATH from that bash step is written, and used in the powershell step. So we don't actually get the powershell-native PATH, we get whatever bash is giving (perhaps that includes MinGW tools).

@joerick
Copy link
Contributor Author

joerick commented Jan 4, 2026

This PR avoids that by outputting a 'prepend-path' variable from the bash step, and updating PATH in the pwsh step.

@henryiii
Copy link
Contributor

henryiii commented Jan 5, 2026

I think I'd prefer the patch-up fixes #2673 and most of #2690; those restore the previous behavior and fix an oversight. Then longer term we can decide if we go this way to improve using "uv" from cibuildwheel's commands (those fixes are related to cibuildwheel itself working correctly). If we do go this way, I want us to remove the uv extra since it doesn't work correctly if we go this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants