From 7970796552c707d378992800b0366e3ebf259686 Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Wed, 16 Oct 2024 09:52:52 +0200 Subject: [PATCH] Fix all pip installations Latest distros do not allow global pip installation. Python packages have to be installed in venv. Signed-off-by: Lukasz Dorau --- .github/workflows/bandit.yml | 7 ++++++- .github/workflows/codeql.yml | 9 +++++++-- .github/workflows/docs.yml | 9 +++++++-- .github/workflows/pr_push.yml | 9 +++++++-- .github/workflows/qemu.yml | 9 ++++++++- 5 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.github/workflows/bandit.yml b/.github/workflows/bandit.yml index acb64034b..d505b57b1 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/bandit.yml @@ -27,8 +27,13 @@ jobs: with: fetch-depth: 0 + # Latest distros do not allow global pip installation - name: Install Bandit - run: python3 -m pip install bandit + run: | + python3 -m venv .venv + . .venv/bin/activate + echo "$PATH" >> $GITHUB_PATH + python3 -m pip install bandit # Run Bandit recursively, but omit _deps directory (with 3rd party code) - name: Run Bandit diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 4a8f3ceb5..a2dfd7e73 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -75,8 +75,13 @@ jobs: sudo apt-get update sudo apt-get install -y cmake clang libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev - - name: Install pip packages - run: python3 -m pip install -r third_party/requirements.txt + # Latest distros do not allow global pip installation + - name: Install Python requirements in venv + run: | + python3 -m venv .venv + . .venv/bin/activate + echo "$PATH" >> $GITHUB_PATH + python3 -m pip install -r third_party/requirements.txt - name: Configure CMake run: > diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 6e128b603..3d9bfc29b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,8 +29,13 @@ jobs: sudo apt-get update sudo apt-get install -y doxygen - - name: Install pip requirements - run: python3 -m pip install -r third_party/requirements.txt + # Latest distros do not allow global pip installation + - name: Install Python requirements in venv + run: | + python3 -m venv .venv + . .venv/bin/activate + echo "$PATH" >> $GITHUB_PATH + python3 -m pip install -r third_party/requirements.txt - name: Setup PATH for python run: echo "$HOME/.local/bin" >> $GITHUB_PATH diff --git a/.github/workflows/pr_push.yml b/.github/workflows/pr_push.yml index 50f8f1aa9..f4463294a 100644 --- a/.github/workflows/pr_push.yml +++ b/.github/workflows/pr_push.yml @@ -66,8 +66,13 @@ jobs: sudo apt-get update sudo apt-get install -y doxygen - - name: Install pip requirements - run: python3 -m pip install -r third_party/requirements.txt + # Latest distros do not allow global pip installation + - name: Install Python requirements in venv + run: | + python3 -m venv .venv + . .venv/bin/activate + echo "$PATH" >> $GITHUB_PATH + python3 -m pip install -r third_party/requirements.txt - name: Setup PATH for python run: echo "$HOME/.local/bin" >> $GITHUB_PATH diff --git a/.github/workflows/qemu.yml b/.github/workflows/qemu.yml index 7834a8b31..7d6724cdd 100644 --- a/.github/workflows/qemu.yml +++ b/.github/workflows/qemu.yml @@ -29,7 +29,14 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-system genisoimage qemu-utils \ libvirt-clients libvirt-daemon-system libvirt-daemon virtinst bridge-utils - pip install -r umf/scripts/qemu/requirements.txt + + # Latest distros do not allow global pip installation + - name: Install Python requirements in venv + run: | + python3 -m venv .venv + . .venv/bin/activate + echo "$PATH" >> $GITHUB_PATH + python3 -m pip install -r umf/scripts/qemu/requirements.txt - name: Add user to kvm group run: sudo usermod -a -G kvm,libvirt $USER