(Ubuntu 22.04) pip version discrepancy
Description
Recent ubuntu-latest (22.04) runner image changed to include pip version 24.x instead of 22.0.2 as claimed.
This seems unintended. If not, consider updating the image's release notes and readme.
See explanation and workaround here: https://github.com/cmu-delphi/delphi-epidata/pull/1503
Platforms affected
- [ ] Azure DevOps
- [X] GitHub Actions - Standard Runners
- [ ] GitHub Actions - Larger Runners
Runner images affected
- [ ] Ubuntu 20.04
- [X] Ubuntu 22.04
- [ ] Ubuntu 24.04
- [ ] macOS 12
- [ ] macOS 13
- [ ] macOS 13 Arm64
- [ ] macOS 14
- [ ] macOS 14 Arm64
- [ ] Windows Server 2019
- [ ] Windows Server 2022
Image version and build link
20240721.1.0 failed: https://github.com/cmu-delphi/delphi-epidata/actions/runs/10095233705/job/27915622079#step:1:10
Is it regression?
yes; most recent run with 20240526.1.0 succeeded: https://github.com/cmu-delphi/delphi-epidata/actions/runs/9290024871/job/25565314861#step:1:9
Expected behavior
i expect pip version 22.0.2 as noted here:
https://github.com/actions/runner-images/blob/ubuntu22/20240721.1/images/ubuntu/Ubuntu2204-Readme.md?plain=1#L39
Actual behavior
we get pip version 24.1.2 as seen here:
https://github.com/cmu-delphi/delphi-epidata/actions/runs/10096915539/job/27920539469#step:5:10
Repro steps
- run a GH action with
runs-on: ubuntu-latest - execute a step with
run: pip -V - observe version mismatch
@melange396 Thank you for bringing this issue to us. We are looking into this issue and will update you on this issue after investigating.
Same issue in Ubuntu20.04. Pip is declared to be 20.0.2 but some cmds that are legal with pip < 22 are reporting errors.
Hi @melange396 We have followed your repro steps for ubuntu-latest. Kindly confirm.
name: Check pip Version
on: [push, pull_request]
jobs:
check-pip-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check pip version
run: pip -V
looks like you may also need:
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
just as we use, to get this output:
Hi @melange396 We have followed your repro steps for ubuntu-latest. Kindly confirm.
name: Check pip Version
on: [push, pull_request]
jobs:
check-pip-version:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install pip version 22
run: |
python -m pip install --upgrade pip==22.0.0
- name: Check pip version
run: pip -V
i think thats almost it, except that if you remove this section
- name: Install pip version 22
run: |
python -m pip install --upgrade pip==22.0.0
it will show that you get pip version 24.1.2 instead of the promised 22.0.2
@melange396 Scenario 1: With actions/setup-python When you use actions/setup-python@v2 to set up Python 3.8, it installs a specific version of Python and its associated pip. By default, this setup installs the latest version of pip that is compatible with Python 3.8. This is why you're seeing pip version 24. Scenario 2: Without actions/setup-python When you do not use actions/setup-python, the workflow uses the system-installed Python and pip, which may be an older version. In this case, it defaults to pip version 22.
Fair enough! Apologies, i guess i should have filed a bug with https://github.com/actions/setup-python (https://github.com/actions/setup-python/issues/901 seems related). It looks like we will need to either keep the step that downgrades pip, or do something else to sort out our dependencies to avoid the error.