Skip to content

refactor!: remove the deprecated Tkinter gui/ (phase 2) - #112

Merged
falbany merged 2 commits into
mainfrom
chore/remove-tkinter-gui-phase2
Nov 4, 2026
Merged

falbany merged 2 commits into
mainfrom
chore/remove-tkinter-gui-phase2

Conversation

@falbany

@falbany falbany commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Closes #50 — complete removal of the deprecated Tkinter layer. The web frontend (React PWA + profiles.server FastAPI + profiles.desktop PyWebView shell) is the only UI.

Code

  • ✅ src/profiles/gui/ deleted (15 modules)
  • ✅ app.py: _run_gui(), --tkinter flag + routing, deprecation banners, gui_backend param, TYPE_CHECKING import, _window attr, stale docstrings — gone. run() routes headless → server-only → web GUI unconditionally
  • ✅ tests/test_app_no_tkinter.py: deleted (the "keep-or-slim" option B) — its unique subject, the tkinter-unavailable ImportError path in _run_gui, no longer exists. The web-only routing assertions it carried live on in TestRun: new test_run_routes_to_web_gui (the "variant asserting web-only behavior") and test_launch_web_backend_calls_desktop (folded in from test_app_backend_selection.py, which is deleted too — backend selection ceased to exist; default-kwargs coverage stays in TestMain)

Tests

  • ✅ tests/gui/ (13 files) and tests/test_app_tk_lifecycle.py deleted

Packaging

  • ✅ sv-ttk + darkdetect out of both dev lists and uv.lock; briefcase comment updated
  • ✅ Guard test test_tk_deps_present_in_both_dev_lists → test_tk_deps_absent_from_dev_lists (absence pinned instead of presence); test_tk_deps_absent_from_runtime_dependencies and test_briefcase_requires_runtime_complete_and_tk_free kept as-is
  • ✅ .coveragerc: profiles/gui omit block removed

Docs (also done here, not left to a follow-up)

  • AGENTS.md + core/AGENTS.md + tests/AGENTS.md + tests/README.md synced (mandated same-commit by the keep-in-sync rule)
  • README.en/fr: Legacy Tkinter Mode sections + tree entries + TOC anchors removed
  • docs/README.md, installation-guide.en/fr: command tables, --help blocks, dependency lists, Linux troubleshooting (now PyWebView/WebKit only)
  • hooks-guide.en/fr: legacy-Tkinter render bullets removed; configuration-profile.en: theme no longer claims darkdetect system detection (web resolves auto → dark)

Deliberate scope decisions (flagging for review)

  1. --web removed together with --tkinter. Not in the issue checklist, but the issue also rules out the gui_backend param — which orphans --web (it existed only to select between two backends). Keeping it as an accepted-but-ignored flag would be dead code; 0.11.0 is already the breaking release. One-line revert if you'd rather keep it.
  2. test_app_backend_selection.py deleted, its desktop-launch test moved into TestRun (single-test supplement file named after a vanished feature).
  3. core/environment/interactions.py / message_dialog.py keep their lazy import tkinter fallbacks — untouched, as they belong to the gui-adjacent legacy hook engine whose fate is decided in the dead-code sweep (Dead code sweep (Python): legacy phase-based hook engine, tests-only helpers, unused --no-config-propose flag #39). Same for the "Extracted from profiles.gui.main_window" provenance docstrings.

Deferred to their own issues (unchanged here)

Verification

  • ruff format --check . + ruff check .: clean
  • pylint src/profiles: 9.87/10 (gate 8.0; R0401 warnings pre-existing Cyclic imports between app/desktop/server/core flagged by pylint (R0401) #42)
  • pytest: 1490 passed, 1 skipped (pre-existing macOS Finder probe), coverage 88.92% (gate 85%)
  • CLI smoke: --help shows no --tkinter/--web; import profiles.app clean
  • pre-commit hooks green on both commits

Delete src/profiles/gui/ (15 modules) and its skipped test tree
(tests/gui/, tests/test_app_tk_lifecycle.py). The web frontend
(React PWA + FastAPI + PyWebView desktop shell) is the only UI.

- app.py: drop _run_gui(), the --tkinter/--web flags, the deprecation
  banners, the gui_backend constructor param, the TYPE_CHECKING
  MainWindow import and the stale _window attribute; run() now routes
  headless -> server-only -> web GUI unconditionally
- tests: test_app_no_tkinter.py deleted (the tkinter-unavailable
  ImportError path it pinned no longer exists); its web-only routing
  coverage is folded into TestRun (run() -> _run_web_gui, desktop
  launch call). test_app_backend_selection.py deleted (backend
  selection ceased to exist)
- packaging: sv-ttk + darkdetect out of both dev lists and uv.lock;
  guard tests now pin their absence from dev lists instead of presence
- .coveragerc: drop the profiles/gui omit block

Fixes the code/tests/packaging sections of #50. Docs sync follows.
- AGENTS.md + src/profiles/core/AGENTS.md + tests/AGENTS.md: gui/ layer
  gone from the trees, presentation layer is web/server/desktop only
- tests/README.md: drop the gui rows/examples and coverage omit note
- README.en/fr: remove the Legacy Tkinter Mode sections, tree entries
  and TOC anchors
- docs/README.md, installation-guide.en/fr: drop --tkinter/--web from
  the command tables, --help blocks and dependency lists; Linux
  troubleshooting now points at the PyWebView/WebKit deps only
- hooks-guide.en/fr: drop the legacy-Tkinter render behavior bullets
- configuration-profile.en: theme auto no longer claims darkdetect
  system detection (the web UI resolves auto to dark)
@falbany
falbany merged commit 4718120 into main Nov 4, 2026
1 check passed
@falbany
falbany deleted the chore/remove-tkinter-gui-phase2 branch November 4, 2026 21:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the deprecated Tkinter gui/ (phase 2) — tracking checklist

1 participant