From 6ac6dd4e12887f561424d5c6b11cfac4d7ac1ff9 Mon Sep 17 00:00:00 2001 From: fanxing11 Date: Sun, 5 Jul 2026 10:42:21 +0800 Subject: [PATCH] fix(uninstall): use --format=freeze (pip 23.0 removed --format=legacy) 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 #1343 --- scripts/uninstall.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/uninstall.sh b/scripts/uninstall.sh index 3fade6147..950ea49d7 100755 --- a/scripts/uninstall.sh +++ b/scripts/uninstall.sh @@ -1,8 +1,9 @@ #!/bin/bash -modules=$(pip3 list --format=legacy | grep 'aw-' | grep -o '^aw-[^ ]*') +# pip removed --format=legacy in 23.0 (2023-01-30); use --format=freeze which +# outputs `aw-core==0.5.x` and is stable across pip versions. +modules=$(pip3 list --format=freeze | grep '^aw-' | grep -o '^aw-[^=]*') for module in $modules; do pip3 uninstall -y $module done -