python-setup: Fix venv creation in Ubuntu 22.04

Fixes https://github.com/github/codeql-action/issues/1249
This commit is contained in:
Rasmus Wriedt Larsen 2022-09-19 09:48:46 +02:00
parent aaca8193b1
commit e1ce6e3115
No known key found for this signature in database
2 changed files with 14 additions and 4 deletions

View file

@ -1,7 +1,11 @@
#! /usr/bin/pwsh
py -2 -m pip install --user --upgrade pip setuptools wheel
py -3 -m pip install --user --upgrade pip setuptools wheel
# while waiting for the next release of `virtualenv` after v20.16.5, we install an older
# version of `setuptools` to ensure that binaries are always put under
# `<venv-path>/bin`, which wouldn't always happen with the GitHub actions version of
# Ubuntu 22.04. See https://github.com/github/codeql-action/issues/1249
py -2 -m pip install --user --upgrade pip 'setuptools<60' wheel
py -3 -m pip install --user --upgrade pip 'setuptools<60' wheel
# virtualenv is a bit nicer for setting up virtual environment, since it will provide up-to-date versions of
# pip/setuptools/wheel which basic `python3 -m venv venv` won't