Skip to content

feat: show spinner during silent install/uninstall phases#87

Open
sclaiborne wants to merge 2 commits into
mainfrom
feature/install-spinner
Open

feat: show spinner during silent install/uninstall phases#87
sclaiborne wants to merge 2 commits into
mainfrom
feature/install-spinner

Conversation

@sclaiborne

Copy link
Copy Markdown
Member

Summary

After npm install exits, lpm still runs getAllDependenciessyncPackagesdeployPackages with no output. That silent gap is what made the pre-#84 hang feel indistinguishable from working behavior — and even with #84's perf fix, larger projects can spend real seconds in syncPackages looking frozen.

Adds a tiny threaded ASCII spinner context manager in src/lpm_core.py and wraps each silent phase in cmd_install / cmd_uninstall (src/LPM.py).

  • ~30 lines, no new dependencies (stdlib threading + itertools + contextlib)
  • Frames are plain ASCII (|/-\) — no Unicode/codepage risk on Windows cmd
  • Daemon thread writes \r| Resolving dependencies... to stdout at 10 Hz; on exit it clears the line so subsequent output is clean
  • Non-TTY fallback: when sys.stdout.isatty() is false (CI logs, redirected output) the spinner degrades to a single static Resolving dependencies... line — no carriage-return spam in pipeline logs

Spinner only runs after npm exits — npm has its own progress UI and we don't want to fight it.

Test plan

  • python -m pytest test/test_unit_core.py — 31/31 pass
  • Non-TTY path verified locally (prints static line, no animation)
  • Reviewer: run lpm install opcua-proxy in a TTY and confirm the spinner animates during the post-npm phases
  • Reviewer: run lpm install redirected to a file (lpm install opcua-proxy > out.txt) and confirm out.txt contains static lines, not carriage-return garbage
  • Reviewer: run lpm uninstall <pkg> and confirm the same spinner appears

sclaiborne and others added 2 commits May 18, 2026 14:59
After npm exits, lpm runs getAllDependencies + syncPackages + deploy with
no output, which made the original PR #84 hang look identical to the
post-fix work. Add a tiny threaded ASCII spinner and wrap each silent
phase in cmd_install and cmd_uninstall so the user sees lpm is still
working. Non-TTY contexts (CI, redirected output) print a static line
instead of carriage-returning animation frames.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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