codeql-action icon indicating copy to clipboard operation
codeql-action copied to clipboard

python-setup: Fix venv creation in Ubuntu 22.04

Open RasmusWL opened this issue 3 years ago • 7 comments

Fixes https://github.com/github/codeql-action/issues/1249

As described here, when using Ubuntu 22.04 with new enough versions of setuptools (60.0.0+), the virtual environment created with virtualenv will put binaries in <venv-path>/local/bin instead of <venv-path>/bin.

Next release after 20.16.5 of virtualenv will include a fix for this (PR).

Merge / deployment checklist

  • [ ] Confirm this change is backwards compatible with existing workflows.
  • [ ] Confirm the readme has been updated if necessary.
  • [ ] Confirm the changelog has been updated if necessary.

RasmusWL avatar Sep 19 '22 07:09 RasmusWL

Could you add ubuntu-22.04 to the matrix in python-deps.yml (and any other relevant tests)?

Done :+1: (but only for the python-setup tests)

RasmusWL avatar Sep 21 '22 07:09 RasmusWL

I don't think Python 2 is preinstalled in the ubuntu-22.04 virtual environment. Would it be reasonable to add the combination of python_version: 2 and os: ubuntu-22.04 to the exclude listing in the matrix, or should we install Python 2 using actions/setup-python?

henrymercer avatar Sep 21 '22 09:09 henrymercer

I don't think Python 2 is preinstalled in the ubuntu-22.04 virtual environment. Would it be reasonable to add the combination of python_version: 2 and os: ubuntu-22.04 to the exclude listing in the matrix, or should we install Python 2 using actions/setup-python?

we have a bit of an internal discussion on how to handle this. Let me get back to this PR once we have figured out what to do.

RasmusWL avatar Sep 21 '22 09:09 RasmusWL

this should fail the Ubuntu 22.04 test, but just want to be able to point to a log file to show that the logic works before disabling the test. If only I had designed the test system to be more flexible, maybe we could have kept the test alive under a form of expected failure mode :thinking:

RasmusWL avatar Sep 21 '22 12:09 RasmusWL

Another way to test this might be adding a step that calls actions/setup-python with python-version: 2, that is only executed when os == ubuntu-22.04 and python_version == 2?

henrymercer avatar Sep 21 '22 13:09 henrymercer

Example of failure here: https://github.com/github/codeql-action/actions/runs/3097944471/jobs/5015231587#step:4:140 (revealed that I had forgotten a few spaces)

RasmusWL avatar Sep 21 '22 13:09 RasmusWL

Taking this out of draft since that reruns the PR checks.

henrymercer avatar Sep 21 '22 14:09 henrymercer