python-setup: Fix venv creation in Ubuntu 22.04
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
Could you add
ubuntu-22.04to the matrix inpython-deps.yml(and any other relevant tests)?
Done :+1: (but only for the python-setup tests)
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?
I don't think Python 2 is preinstalled in the
ubuntu-22.04virtual environment. Would it be reasonable to add the combination ofpython_version: 2andos: ubuntu-22.04to theexcludelisting in the matrix, or should we install Python 2 usingactions/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.
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:
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?
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)
Taking this out of draft since that reruns the PR checks.