Skip to content

Commit c22910c

Browse files
committed
fix: add PIP_BREAK_SYSTEM_PACKAGES fallback for plot generation
Try venv first; if venv fails (missing ensurepip), fall back to get-pip.py with PIP_BREAK_SYSTEM_PACKAGES=1 to bypass PEP 668. Made-with: Cursor
1 parent a177772 commit c22910c

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/ci-benchmark.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,11 +578,18 @@ jobs:
578578
- name: Generate benchmark plots
579579
if: always()
580580
run: |
581-
echo "Installing matplotlib and numpy via venv..."
582-
python3 -m venv /tmp/plot-venv
583-
/tmp/plot-venv/bin/pip install --quiet matplotlib numpy 2>&1 || echo "WARNING: Could not install matplotlib — plots will be skipped"
584-
export PATH="/tmp/plot-venv/bin:$PATH"
585-
python3 - <<'PLOTEOF'
581+
echo "Installing matplotlib and numpy..."
582+
if python3 -m venv /tmp/plot-venv 2>&1; then
583+
/tmp/plot-venv/bin/pip install --quiet matplotlib numpy 2>&1
584+
PYTHON=/tmp/plot-venv/bin/python3
585+
else
586+
echo "venv failed, using PIP_BREAK_SYSTEM_PACKAGES fallback..."
587+
curl -sSL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
588+
PIP_BREAK_SYSTEM_PACKAGES=1 python3 /tmp/get-pip.py --user 2>&1
589+
PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip install --user matplotlib numpy 2>&1
590+
PYTHON=python3
591+
fi
592+
$PYTHON - <<'PLOTEOF'
586593
import json, os, sys
587594
try:
588595
import matplotlib

0 commit comments

Comments
 (0)