chore: Update CI workflow to install Python 3.12 using pyenv
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m31s
CI / lint-and-type-check (pull_request) Successful in 2m15s
CI / python-lint (pull_request) Successful in 1m57s
CI / test-backend (pull_request) Successful in 3m59s
CI / build (pull_request) Failing after 4m5s
CI / secret-scanning (pull_request) Successful in 1m41s
CI / dependency-scan (pull_request) Successful in 1m37s
CI / sast-scan (pull_request) Successful in 2m53s
CI / workflow-summary (pull_request) Successful in 1m29s

This commit modifies the CI workflow to install Python 3.12 using pyenv instead of the default package manager. This change is necessary as Debian Bullseye does not provide Python 3.12 in its default repositories. The updated installation process includes necessary dependencies and ensures that the correct version of Python is set globally for the build environment.
This commit is contained in:
Tanya 2026-01-09 12:37:43 -05:00
parent 6e8a0959f2
commit c02d375da7

View File

@ -419,10 +419,23 @@ jobs:
- name: Validate backend (imports and app instantiation)
run: |
# Install Python 3.12 (required for modern type hints like str | None)
apt-get update && apt-get install -y software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update && apt-get install -y python3.12 python3.12-venv python3.12-dev
# Install Python 3.12 using pyenv (required for modern type hints like str | None)
# Debian Bullseye doesn't have Python 3.12 in default repos, so we use pyenv
apt-get update && apt-get install -y \
make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
libffi-dev liblzma-dev git
# Install pyenv
export PYENV_ROOT="/opt/pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
curl https://pyenv.run | bash
# Install Python 3.12 using pyenv
eval "$(pyenv init -)"
pyenv install -v 3.12.7
pyenv global 3.12.7
# Create virtual environment with Python 3.12
python3.12 -m venv /tmp/backend-venv