From 3038a9e63342eb68bcb1fdba77c21ff9f387b192 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Wed, 21 Aug 2024 10:35:06 +0200 Subject: [PATCH] Use a virtualenv to install pre-commit Avoid running into issues with underlying python packages --- .github/workflows/pre-commit.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3a5528a69..1f2e9275a 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -19,11 +19,12 @@ jobs: view-path: /cvmfs/sw-nightlies.hsf.org/key4hep run: | echo "::group::Setup pre-commit" - export PATH=/root/.local/bin:$PATH # Newer versions of git are more cautious around the github runner # environment and without this git rev-parse --show-cdup in pre-commit # fails git config --global --add safe.directory $(pwd) + python -m venv /root/pre-commit-venv + source /root/pre-commit-venv/bin/activate pip install pre-commit pip install pylint==2.17.7 pip install flake8