FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Check for Tkinter in `pn doctor` (required by `pn preview`) · Issue #23 · pythonnative/pythonnative · GitHub

Repository navigation

Check for Tkinter in pn doctor (required by pn preview) #23

Description

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL