fix: Use Python 3.12 in CI build validation step
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m30s
CI / lint-and-type-check (pull_request) Successful in 2m17s
CI / python-lint (pull_request) Successful in 2m0s
CI / test-backend (pull_request) Successful in 5m22s
CI / build (pull_request) Failing after 1m46s
CI / secret-scanning (pull_request) Successful in 1m39s
CI / dependency-scan (pull_request) Successful in 1m37s
CI / sast-scan (pull_request) Successful in 2m55s
CI / workflow-summary (pull_request) Successful in 1m29s

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.
This commit is contained in:
Tanya 2026-01-09 12:24:56 -05:00
parent 08e0fc8966
commit 6e8a0959f2

View File

@ -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)