fix(uninstall): use --format=freeze (pip 23.0 removed --format=legacy)#1349
Closed
fanxing11 wants to merge 1 commit into
Closed
fix(uninstall): use --format=freeze (pip 23.0 removed --format=legacy)#1349fanxing11 wants to merge 1 commit into
fanxing11 wants to merge 1 commit into
Conversation
pip 23.0 (2023-01-30) removed the deprecated `--format=legacy` option.
On pip >= 23.0 `scripts/uninstall.sh` fails with:
option --format: invalid choice: 'legacy' (choose from 'columns', 'freeze', 'json')
The outer `grep 'aw-'` then receives empty stdin, `$modules` stays empty,
the for loop is a no-op and users think uninstall succeeded.
Switch to `--format=freeze` (output shape `aw-core==0.5.x`) and update the
grep to strip on `=` instead of space so package names are extracted
correctly with the new format.
Fixes ActivityWatch#1343
Contributor
Contributor
|
Thanks for the contribution @fanxing11! This is actually a duplicate of #1344 which was already submitted, has full CI green (12/12 checks), and uses a slightly cleaner approach with Both fixes are correct — the maintainer will pick one to merge. Appreciate you taking the time to submit a fix! 🙏 |
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.
Fixes #1343.
pip 23.0 (2023-01-30) removed the deprecated
--format=legacy, so on any modern pipscripts/uninstall.shbails out with:The outer
grep 'aw-'then reads empty stdin,$modulesis empty, the loop is a no-op — and the user thinks uninstall worked.Switched to
--format=freeze(output shapeaw-core==0.5.x), which is stable across all supported pip versions. Also tweaked the secondgrep -oto strip on=instead of space so it still picks up just the package name.Quick check:
bash -n scripts/uninstall.shpasses.