feat: show spinner during silent install/uninstall phases#87
Open
sclaiborne wants to merge 2 commits into
Open
feat: show spinner during silent install/uninstall phases#87sclaiborne wants to merge 2 commits into
sclaiborne wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After
npm installexits, lpm still runsgetAllDependencies→syncPackages→deployPackageswith 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 insyncPackageslooking 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).threading+itertools+contextlib)|/-\) — no Unicode/codepage risk on Windows cmd\r| Resolving dependencies...to stdout at 10 Hz; on exit it clears the line so subsequent output is cleansys.stdout.isatty()is false (CI logs, redirected output) the spinner degrades to a single staticResolving dependencies...line — no carriage-return spam in pipeline logsSpinner 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 passlpm install opcua-proxyin a TTY and confirm the spinner animates during the post-npm phaseslpm installredirected to a file (lpm install opcua-proxy > out.txt) and confirmout.txtcontains static lines, not carriage-return garbagelpm uninstall <pkg>and confirm the same spinner appears