What
pn preview requires Tkinter, but pn doctor doesn't check for it. On systems where Python was installed without tcl/tk (common with Homebrew and slim Linux images), doctor reports "Everything looks good" and the failure only surfaces later when pn preview errors out. Doctor should catch this up front.
Where to look
- src/pythonnative/project/doctor.py: check_common() (around line 64) already probes Pillow with a try-import and appends a CheckResult; mirror that pattern with import tkinter.
- src/pythonnative/cli/pn.py: preview_project() (around line 216) has the per-OS install instructions (brew, apt, Windows installer) you can reuse in the check's hint text.
- Severity: WARN seems right, since Tkinter is only needed for the desktop preview, not for Android or iOS builds.
Acceptance criteria
- pn doctor reports a "Tkinter (desktop preview)" line: [ok] when importable, [!] with a short install hint when not.
- A unit test covers both outcomes (for example, by monkeypatching the import).
- ./scripts/check.sh passes.
Notes for contributors
See CONTRIBUTING.md for setup. Suggested PR title: feat(cli): check for Tkinter in pn doctor.
Reactions are currently unavailable
What
pn preview requires Tkinter, but pn doctor doesn't check for it. On systems where Python was installed without tcl/tk (common with Homebrew and slim Linux images), doctor reports "Everything looks good" and the failure only surfaces later when pn preview errors out. Doctor should catch this up front.
Where to look
Acceptance criteria
Notes for contributors
See CONTRIBUTING.md for setup. Suggested PR title: feat(cli): check for Tkinter in pn doctor.