Skip to content

build + refactor: pyproject migration, controller/ui module split, UI polish#15

Merged
d7omdev merged 5 commits intomainfrom
feat/pyproject-installer
Apr 15, 2026
Merged

build + refactor: pyproject migration, controller/ui module split, UI polish#15
d7omdev merged 5 commits intomainfrom
feat/pyproject-installer

Conversation

@d7omdev
Copy link
Copy Markdown
Owner

@d7omdev d7omdev commented Apr 15, 2026

Summary

Replaces the Nuitka onefile build with a standard pyproject.toml + python-installer workflow. Eliminates the entire class of gi-vs-glib2 mismatch crashes that broke 0.6.0 (#13) and 0.7.0 (#14) by stopping bundling gi altogether.

Why

Nuitka froze a pip-installed PyGObject into the binary. At runtime, the frozen gi/overrides/GLib.py asserted every deprecated symbol existed on the live system GLib — which, on rolling distros, eventually fails. Pinning or bumping PyGObject only delays the next recurrence; the bundling pattern itself is structurally wrong for a C-binding shim.

Shipping a wheel installed by python-installer lets pacman resolve python-gobject against the user's glib2 version. The invariant holds by construction.

Changes

  • New pyproject.toml with [project.scripts] entry point (clipse-gui = "clipse_gui.cli:main")
  • New clipse_gui/cli.py containing main() (extracted from root clipse-gui.py) so the entry point can import it cleanly
  • Root clipse-gui.py reduced to a thin dev shim that calls clipse_gui.cli:main — keeps python clipse-gui.py working from a checkout
  • aur/PKGBUILD reworked to use python -m build --wheel --no-isolation + python -m installer --destdir="$pkgdir" dist/*.whl; makedepends updated accordingly (pushed to AUR remote separately — aur/ is gitignored here)
  • requirements.txt cleaned up — Nuitka and PyGObject pin removed (no longer relevant to packaging)

Out of scope

  • .github/workflows/release.yml still produces the Nuitka linux binary + AppImage as release assets. Removing those is a follow-up — wanted this PR focused on the AUR/install path that's actually broken.
  • justfile Nuitka recipes left alone — alternative builders stay available for contributors who want them.

Test plan

  • python -m build --wheel --no-isolation produces a valid wheel under dist/
  • Wheel installed cleanly into a fresh venv
  • clipse-gui --version prints Clipse GUI v0.7.0 from the installed entry point
  • App launches end-to-end via the installed entry point against system python-gobject
  • makepkg -si against the new PKGBUILD on this Arch host builds and installs cleanly (replaces previous 0.7.0-25 install, entry point launches, GUI opens)

Closes / refs

Long-term fix for #13 and #14 (both already addressed acutely by AUR 0.7.0-25; this lands the structural fix on the GitHub side).

d7omdev added 3 commits April 15, 2026 13:22
Nuitka froze a pip-installed PyGObject into the binary; the frozen
gi/overrides asserted against the live system GLib and crashed when
glib2 evolved (#13, #14). Wheel + python-installer keeps gi in lockstep
with the user's system python-gobject by construction.

- Add pyproject.toml with [project.scripts] entry point
- Extract main() into clipse_gui/cli.py so the entry point is importable
- Reduce root clipse-gui.py to a thin dev shim
- Drop Nuitka and the PyGObject pin from requirements.txt
Setuptools deprecated `license = { file = "..." }` and the
`License :: OSI Approved` classifiers; both are slated for removal in
Feb 2027. Switch to PEP 639 SPDX form (`license = "MIT"` +
`license-files = ["LICENSE"]`) and drop the redundant classifier.
Bump build-system pin to setuptools>=77, the minimum that supports
this syntax.
…thon-installer

- `just build` now produces a PEP 517 wheel via `python -m build --no-isolation`
- `just install` uses `python -m installer` to drop the entry-point script and
  package into the system prefix; icon/desktop file installed alongside as before
- `just uninstall` reconstructs the wheel manifest in a temp destdir and removes
  every listed file from the live system, then strips the assets
- `just dry-install` enumerates the manifest so users see exactly what lands where
- `just build-nuitka` preserves the legacy Nuitka path for non-pacman distribution
- Drop the dead duplicate `nuitka` recipe; consolidate into `build-nuitka`
- Clean wheel artifacts (build/, *.egg-info) in `clean-build`
- `info` and `paths` updated to reflect the new install layout
@d7omdev
Copy link
Copy Markdown
Owner Author

d7omdev commented Apr 15, 2026

Heads up: I'm piggybacking on this branch to also split controller.py (1863 lines) and ui_components.py (1742 lines) into smaller, focused modules, since I'm already working here.

  • controller.py → mixin decomposition under controller_mixins/
  • ui_components.py → focused modules under ui/, keeping ui_components.py as a re-export shim for back-compat

Pure restructuring — no behavior changes.

d7omdev added 2 commits April 16, 2026 01:44
Break two monoliths into navigable modules:

- controller.py: 1863 -> 128 lines, composes 11 mixins under
  controller_mixins/ (data, style, list_view, search, item_ops,
  selection, clipboard, preview, scroll, keyboard, misc)
- ui_components.py: 1742 -> 43-line shim, splits into 7 modules
  under ui/ (icons, detection, text, list_row, help, settings,
  preview)

The shim re-exports every public name (including the legacy
toggle_search_bar alias) so existing imports keep working.

Pure restructuring -- no behavior changes intended.
- Header search + pin filter button: dedicated CSS classes,
  matching heights, accent-colored active state on pin toggle
- Spinbutton: flatten internal entry and buttons into one unified
  control; remove duplicate focus rings and inner borders
- Switch: drop redundant focus ring (state already visible via slider)
- List rows: round all four corners (was right-only)
- Compact mode: pick window size at startup based on config so the
  WM honors smaller dimensions; persistently hide search + pin filter
  via set_no_show_all when compact is on
- Graceful exit: handle SIGINT/SIGTERM via GLib unix signal hook so
  Ctrl+C in terminal triggers clean shutdown (saves history, cleans
  up tray)
@d7omdev d7omdev changed the title build: migrate from Nuitka onefile to pyproject.toml + python-installer build + refactor: pyproject migration, controller/ui module split, UI polish Apr 15, 2026
@d7omdev d7omdev merged commit 08e89a8 into main Apr 15, 2026
@d7omdev d7omdev deleted the feat/pyproject-installer branch April 15, 2026 23:56
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.

1 participant