Commit 9d7f9e1f authored by Sergio Gimenez's avatar Sergio Gimenez
Browse files

fix(ci): use venv to bypass PEP 668 on shell executor

Shell executor host Python 3.13 (Debian) enforces PEP 668, blocking
system-wide pip. Create and activate a venv in before_script for all
jobs that need Python packages. Cache .venv/ for faster reruns.
parent 20e5f486
Loading
Loading
Loading
Loading
Loading
+15 −11
Changes for .gitlab-ci.yml: 15 added lines, 11 removed lines.
Original line number Diff line number Diff line
@@ -14,13 +14,15 @@ variables:
cache:
  paths:
    - .cache/pip
    - .venv/

.ansible_setup:
  before_script:
    - python3 --version
    - python3 -m pip install --upgrade pip 2>/dev/null || curl -sS https://bootstrap.pypa.io/get-pip.py | python3
    - python3 -m pip install --upgrade pip
    - python3 -m pip install -r ansible/requirements.txt
    - python3 -m venv .venv
    - source .venv/bin/activate
    - pip install --upgrade pip
    - pip install -r ansible/requirements.txt
    - ansible-galaxy collection install -r ansible/requirements.yml

secret-scan:
@@ -67,10 +69,11 @@ docs:
  stage: docs
  script:
    - python3 --version
    - python3 -m pip install --upgrade pip 2>/dev/null || curl -sS https://bootstrap.pypa.io/get-pip.py | python3
    - python3 -m pip install --upgrade pip
    - python3 -m pip install -r docs/requirements.txt
    - python3 -m mkdocs build --strict
    - python3 -m venv .venv
    - source .venv/bin/activate
    - pip install --upgrade pip
    - pip install -r docs/requirements.txt
    - mkdocs build --strict
  artifacts:
    paths:
      - public
@@ -80,10 +83,11 @@ pages:
  stage: deploy
  script:
    - python3 --version
    - python3 -m pip install --upgrade pip 2>/dev/null || curl -sS https://bootstrap.pypa.io/get-pip.py | python3
    - python3 -m pip install --upgrade pip
    - python3 -m pip install -r docs/requirements.txt
    - python3 -m mkdocs build --strict
    - python3 -m venv .venv
    - source .venv/bin/activate
    - pip install --upgrade pip
    - pip install -r docs/requirements.txt
    - mkdocs build --strict
  artifacts:
    paths:
      - public