ci: support python 3.9 legacy get-pip bootstrap endpoint dynamically

This commit is contained in:
2026-09-25 22:33:08 +02:00
parent 8c6d3f57f9
commit ea3a2cd541
2 changed files with 18 additions and 4 deletions
+9 -2
View File
@@ -31,9 +31,16 @@ jobs:
fi
fi
# 2. Bootstrap pip via ensurepip or get-pip.py
# 2. Bootstrap pip via ensurepip or version-appropriate get-pip.py
if ! python3 -m pip --version >/dev/null 2>&1; then
python3 -m ensurepip --default-pip 2>/dev/null || (python3 -c "import urllib.request; urllib.request.urlretrieve('https://bootstrap.pypa.io/get-pip.py', '/tmp/get-pip.py')" && python3 /tmp/get-pip.py --break-system-packages 2>/dev/null || python3 /tmp/get-pip.py 2>/dev/null || true)
python3 -m ensurepip --default-pip 2>/dev/null || python3 -c "
import sys, urllib.request, subprocess
ver = f'{sys.version_info.major}.{sys.version_info.minor}'
url = f'https://bootstrap.pypa.io/pip/{ver}/get-pip.py' if sys.version_info < (3, 10) else 'https://bootstrap.pypa.io/get-pip.py'
print(f'[*] Downloading get-pip.py from {url} for Python {ver}...')
urllib.request.urlretrieve(url, '/tmp/get-pip.py')
subprocess.run([sys.executable, '/tmp/get-pip.py', '--break-system-packages'])
" || true
fi
# 3. Upgrade pip and install project dependencies