From c02d375da76ec93312e89d3fd8bef56503b3163b Mon Sep 17 00:00:00 2001 From: Tanya Date: Fri, 9 Jan 2026 12:37:43 -0500 Subject: [PATCH] chore: Update CI workflow to install Python 3.12 using pyenv 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. --- .gitea/workflows/ci.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index c71e69d..e2f3fd7 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -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