Skip to content

Commit 711c147

Browse files
author
AI Assistant
committed
fix(upgrade-all): skip pip upgrade when python has no pip module
- Check if python3 -m pip is available before attempting upgrade - Handles virtualenvs without pip installed gracefully - Provides clear skip message: 'pip (python3 has no pip module)'
1 parent 46795de commit 711c147

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/upgrade_all.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ stage_2_managers() {
166166

167167
# Language-specific package managers
168168
if command -v pip3 >/dev/null 2>&1; then
169+
# Check if pip module is actually available
170+
if ! python3 -m pip --version >/dev/null 2>&1; then
171+
log_skip "pip (python3 has no pip module)"
169172
# Check if in virtualenv - skip --user flag if so
170-
if [ -n "${VIRTUAL_ENV:-}" ]; then
173+
elif [ -n "${VIRTUAL_ENV:-}" ]; then
171174
run_cmd "pip" python3 -m pip install --upgrade pip || log_skip "pip (failed)"
172175
else
173176
run_cmd "pip" python3 -m pip install --user --upgrade pip || log_skip "pip (failed)"

0 commit comments

Comments
 (0)