From 6e8a0959f23b8e83e751f4189a48f306a1ea79fb Mon Sep 17 00:00:00 2001 From: Tanya Date: Fri, 9 Jan 2026 12:24:56 -0500 Subject: [PATCH] fix: Use Python 3.12 in CI build validation step The codebase uses Python 3.10+ syntax (str | None) which is not supported in Python 3.9. Update the build job to install and use Python 3.12 to match the test-backend job and support modern type hints. --- .gitea/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index fe6ae14..c71e69d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -419,11 +419,13 @@ jobs: - name: Validate backend (imports and app instantiation) run: | - # Install Python and pip - apt-get update && apt-get install -y python3 python3-pip python3-venv + # 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 - # Create virtual environment - python3 -m venv /tmp/backend-venv + # Create virtual environment with Python 3.12 + python3.12 -m venv /tmp/backend-venv # Use venv's pip and python directly (avoids shell activation issues) # Install core dependencies including numpy and pillow (needed for module-level imports)