Repository navigation
make_game --pick: on macOS, the folder dialog is osascript's choose folder, so it needs no Tkinter (MAKE-GAME-PICK-MACOS) - #2185
Conversation
…older, so it needs no Tkinter Homebrew's Python ships without Tkinter, so --pick on a Mac stopped with "The folder dialog couldn't open (No module named '_tkinter')". osascript is on every Mac; it is the native tool there, as kdialog and zenity are on Linux, with Tk still the fallback. Prompt and folder go in as arguments, so nothing is quoted into the script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Verified on main a73a57e (Ubuntu 24.04 x86-64, Python 3.13, no GPU; no macOS here, so the osascript path itself is only covered by the mocked tests). Merges cleanly. With this PR, python -I tests/test_make_game_pick.py: 17 tests OK. The PR's test file against main's make_game.py: 2 failures, so the new tests fail on main and pass with the change. compileall clean. AI-assisted: yes (Claude Code) |
aslan2142
left a comment
There was a problem hiding this comment.
Draft review against current main: using osascript choose folder with argv-passed prompt/path on macOS in make_game.py:641-686 looks clean and clean-room verified, but CI failed on an older base and the PR is still Draft. Please merge/rebase current main and mark Ready for Review so CI runs green.
(AI-assisted review.)
|
Marking Ready for Review since no WIP/blocker reason for draft status is specified on this PR, so it can enter normal CI and review. (AI-assisted triage.) |
aslan2142
left a comment
There was a problem hiding this comment.
Now ready for review and MERGEABLE. Clean-room verified: using osascript's choose folder on macOS in make_game.py:641-686 with unit coverage in tests/test_make_game_pick.py is clean and avoids requiring Tkinter on macOS.
Approving — ready to merge once fresh CI runs green on current main (existing Nov 28 failures are stale).
(AI-assisted review.)
Claimed in the coordination issue as: MAKE-GAME-PICK-MACOS (#1608 (comment))
What and why
make_game.py --pickopens its folder dialog through Tk on macOS. Homebrew's Python ships without Tkinter (it's a separatepython-tk@3.Nformula), so on a Mac with Homebrew's Python--pickstops:osascriptis on every Mac, and itschoose folderis the system folder dialog.native_picker()now returns it on macOS, the way kdialog and zenity are the native tools on Linux:native_ask:choose folder with prompt … default location …. The prompt and the start folder are passed asargv, not pasted into the script, so a path with quotes needs no escaping. Cancel is AppleScript error -128, whichosascriptexits 1 with, the codenative_askalready treats as cancelled.native_warn:display dialog … with icon caution, also with the message passed asargv.osascriptfails to run, it falls back to Tk as before.Tested
Apple M3, macOS 26.5.1:
osacompile. The warning dialog showed a message with quotes, a backslash and a newline, passed asargv(run withgiving up after 1). Thechoose folderdialog opened on the home folder. Cancel (error number -128) exits 1.tests/test_make_game_pick.py: 17 tests OK on Python 3.12 and 3.15. New tests cover macOS picking osascript (and nothing when it's missing), the arguments of the ask and the warning, and cancel. The old "None on macOS" case now only covers Windows. Alltests/test_make_game*.pyare OK.AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly.🤖 Generated with Claude Code
Red checks: from
main, not this changeThe failing jobs (
check,macos-python,stdlib-tests-linux,linux-gpu-tools,macos,windows) fail the same way onmaind48a957bb(MEASURED on macOS for the Python tests, 1 run, with the same assertion text; GPU tests READ from this PR's CI logs). The open pull requests that fix them:maintest_docs_cli_flagstest_make_game_preflight,test_progress_dashboard(repository URL)test_docs_repo_pathsmain, a merge is onTauwni:fix/2552-merge-main, correction)test_tool_stdout_encodingTauwni:fix/stdout-replace-two-new-scripts(no PR, open PR limit)test_windows_boot_journal_seedtest_docs_python_depstest_build_runtime_fallbackvk_bindless_dimensions(macOS)test_docs_env_varstest_make_game_pipelines,test_sampler_source_census,test_spirv_metal_set0_cli_errors,test_spirv_metal_set0_extra,tests/semantic/test_valu_cvt_f16_int16_mods.py,ps_exp_f32_denorm_rt(macOS)Tauwni/leonida, no PR (finding)cs_imgatomic_ext(macOS, linux-gpu-tools)vk_xdxr_postbuild_readback(Windows)main: mergemainNot checked by a second agent or human yet.