Skip to content

Commit 2190402

Browse files
committed
Fix CI pip install failure on Ubuntu 24.04
Replaces `--force-reinstall` with `--ignore-installed` when bootstrapping pip. On Ubuntu 24.04, the system-managed pip (v24.0) lacks a RECORD file, causing `--force-reinstall` to fail with "uninstall-no-record-file". Using `--ignore-installed` allows the installation to proceed by overwriting without attempting a broken uninstallation.
1 parent 4227782 commit 2190402

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

.github/workflows/notebook-test.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
timeout-minutes: 120 # Optional: Cap the job at 2 hours
9-
10-
9+
10+
1111
env:
1212
NODE_EXTRA_CA_CERTS: /etc/ssl/certs/ca-certificates.crt
1313
SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
@@ -20,14 +20,14 @@ jobs:
2020
- name: Set environment variables
2121
run: |
2222
echo "DEBIAN_FRONTEND=noninteractive" >> $GITHUB_ENV
23-
23+
2424
# Detect if running on GitHub Actions (not Gitea or act)
2525
if [[ "${{ github.server_url }}" == "https://github.com" ]] && [[ -z "${{ env.ACT }}" ]]; then
2626
echo "Running on GitHub - using CPU-only PyTorch"
2727
echo "PIP_EXTRA_INDEX_URL=https://download.pytorch.org/whl/cpu" >> $GITHUB_ENV
2828
echo "TORCH_CPU_ONLY=true" >> $GITHUB_ENV
2929
fi
30-
30+
3131
if [[ "${{ vars.IS_GITEA }}" == "true" ]]; then
3232
echo "Setting thread limits for Gitea runner"
3333
echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
@@ -37,17 +37,17 @@ jobs:
3737
echo "NUMEXPR_NUM_THREADS=1" >> $GITHUB_ENV
3838
fi
3939
40-
- name: Install Act dependencies
41-
if: ${{ env.ACT }}
42-
run: |
40+
- name: Install Act dependencies
41+
if: ${{ env.ACT }}
42+
run: |
4343
apt-get update && apt-get install -y sudo
4444
4545
- name: Install Runner Dependencies & Configure CA
4646
run: |
4747
sudo apt-get update
4848
# Install Node.js (for JS-based actions) & ca-certificates
4949
sudo apt-get install -y nodejs ca-certificates
50-
50+
5151
# This trusts your mounted certificate (from the act command)
5252
sudo update-ca-certificates
5353
@@ -68,35 +68,35 @@ jobs:
6868
run: |
6969
sudo apt-get update
7070
sudo apt-get install -y libgomp1
71-
71+
7272
- name: Install Java for H2O
7373
run: |
7474
sudo apt-get update
7575
sudo apt-get install -y default-jre
76-
76+
7777
- name: Install build dependencies
7878
run: |
7979
sudo apt-get update
80-
sudo apt-get install -y build-essential
80+
sudo apt-get install -y build-essential
8181
8282
- name: Install Python 3.12 and Git
8383
run: |
8484
sudo apt-get update
8585
sudo apt-get install -y lsb-release software-properties-common gnupg curl git
8686
8787
# --- THIS IS THE GPG KEY FIX ---
88-
88+
8989
sudo gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BA6932366A755776
9090
sudo gpg --export BA6932366A755776 | sudo gpg --dearmor -o /usr/share/keyrings/deadsnakes-archive-keyring.gpg
9191
# --- END FIX ---
9292
9393
echo "deb [signed-by=/usr/share/keyrings/deadsnakes-archive-keyring.gpg] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ppa.list
94-
94+
9595
sudo apt-get update
9696
sudo apt-get install -y python3.12 python3.12-venv python3.12-dev
9797
9898
# Install pip for Python 3.12 (force reinstall to avoid Debian package conflicts)
99-
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.12 - --break-system-packages --force-reinstall
99+
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3.12 - --break-system-packages --ignore-installed
100100
101101
sudo ln -sf /usr/bin/python3.12 /usr/local/bin/python
102102
sudo ln -sf /usr/bin/python3.12 /usr/local/bin/python3
@@ -118,7 +118,7 @@ jobs:
118118
source "$VENV_PATH/bin/activate"
119119
which python
120120
python --version
121-
121+
122122
# Verify PyTorch installation type
123123
python -c "import torch; print(f'PyTorch version: {torch.__version__}'); print(f'CUDA available: {torch.cuda.is_available()}')"
124124
@@ -130,6 +130,6 @@ jobs:
130130
echo "Ensuring setuptools is installed to provide pkg_resources for hyperopt..."
131131
python -m pip install 'setuptools<70.0.0'
132132
pytest --nbmake --nbmake-timeout=4500 --nbmake-kernel=ml_grid_env notebooks/unit_test_synthetic.ipynb
133-
133+
134134
echo "Running Python unit tests..."
135-
pytest tests/
135+
pytest tests/

0 commit comments

Comments
 (0)