Add Linux setup script and clearer native-window diagnostics

Provide desktop/setup_linux.sh for apt + system-site-packages uv venv,
point docs at it, and print Python version plus the real gi/typelib error
when falling back to the browser.

Co-authored-by: Diaco Soltanpour <s-diaco@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-07-22 11:22:09 +00:00
parent 63bd3b0f0e
commit ba1231c73d
4 changed files with 161 additions and 40 deletions

View File

@@ -28,24 +28,24 @@ Select with `--backend com|ooxml` (CLI) or the Backend dropdown (web UI).
interactive selection still works for config loading, but globbing finds no templates.
- NiceGUI defaults to a native window (`pywebview`). On Linux that needs **system**
GTK/WebKit packages (`python3-gi`, `gir1.2-gtk-3.0`, `gir1.2-webkit2-4.1` via apt) —
not installable with `uv`. Isolated uv venvs do not see apt `python3-gi` unless
created with `uv venv --system-site-packages` (or the app appends
`/usr/lib/python3/dist-packages`). On this headless/cloud VM native mode is often
unavailable; the app falls back to the browser, or use `--no-browser` / `--browser`.
not installable with `uv`. Prefer `./desktop/setup_linux.sh`, which recreates
`.venv` with `uv venv --system-site-packages`. Isolated uv venvs otherwise miss
apt `python3-gi` unless the app can append `/usr/lib/python3/dist-packages`.
On this headless/cloud VM native mode is often unavailable; the app falls back
to the browser, or use `--no-browser` / `--browser`.
### Environment
- Prefer **uv** for all installs (`uv` in `~/.local/bin`, on PATH via `~/.bashrc`).
- Rye is **not** used (`requirements.lock` removed). Use `uv.lock` + `uv sync`.
```bash
uv sync
```
# Linux desktop (native window + Desktop shortcut):
./desktop/setup_linux.sh
On a Linux desktop where you want the native window, prefer:
```bash
uv venv --system-site-packages
# Deps only (any OS); Linux native window needs --system-site-packages:
uv sync
# or:
uv venv --python python3 --system-site-packages && uv sync
```
- Run Python via the venv interpreter: `.venv/bin/python`.
@@ -62,6 +62,7 @@ Select with `--backend com|ooxml` (CLI) or the Backend dropdown (web UI).
- CLI: `.venv/bin/python -m xlsx_clean.clean_cells` (defaults to `ooxml` on Linux).
- Web UI: `.venv/bin/python -m xlsx_clean.web_app` (native window) or
`--no-browser` / `--browser` on headless / for default browser.
- Linux setup: `./desktop/setup_linux.sh` (apt + system-site-packages venv + shortcut).
- Desktop shortcut (Linux): `.venv/bin/python desktop/install_desktop_shortcut.py`
- Windows shop-floor: double-click `desktop/Setup.bat` (uv sync + shortcut), or build
an exe with `desktop/build_windows_exe.bat` **on a Windows PC** (cannot build Windows