Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pythonw support on gui scripts #4409

Merged
merged 4 commits into from
Jun 23, 2024
Merged

Conversation

samypr100
Copy link
Contributor

@samypr100 samypr100 commented Jun 19, 2024

Summary

Closes #2956

This changes the bootstrap launcher script to use pythonw.exe instead of python.exe on gui_scripts via a helper fn both in the shebang and the python exe path encoded before UVUV magic, that way uv-trampoline's find_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 says The 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 when is_gui is set.

Was the intention to do this in uv-trampoline at some point instead?

@zanieb zanieb requested a review from konstin June 19, 2024 00:51
@samypr100 samypr100 marked this pull request as ready for review June 19, 2024 01:35
@konstin
Copy link
Member

konstin commented Jun 23, 2024

I noticed the docs in fn windows_script_launcher says The 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.

Thanks, that's indeed wrong, i removed it.

@konstin konstin enabled auto-merge (squash) June 23, 2024 09:41
@konstin konstin merged commit 2288ff7 into astral-sh:main Jun 23, 2024
47 checks passed
@samypr100 samypr100 deleted the pythonw-search branch June 23, 2024 13:42
@charliermarsh
Copy link
Member

Nice, thank you for this @samypr100!

@zanieb zanieb added the enhancement New feature or request label Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GUI scripts open a terminal window
4 participants