feat: pythonw support on gui scripts #4409
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Closes #2956
This changes the bootstrap launcher script to use
pythonw.exe
instead ofpython.exe
ongui_scripts
via a helper fn both in the shebang and the python exe path encoded beforeUVUV
magic, that way uv-trampoline'sfind_python_exe
can use the right pythonw executable.Test Plan
New unit tests for the helper was added.
Tested on example from #2956 on Windows to make sure it works as expected.
Questions
I noticed the docs in
fn windows_script_launcher
saysThe launcher will look for `python[w].exe` adjacent to it in the same directory to start the embedded script.
but I didn't find such functionality when I looked in uv-trampoline.I only saw
clear_app_starting_state
getting called whenis_gui
is set.Was the intention to do this in uv-trampoline at some point instead?