feat: upgrade Docker image to Python 3.13

Upgrade from Python 3.12.3 to Python 3.13.3 using deadsnakes PPA.

Changes:
- Add build.sh execution in Dockerfile to install Python 3.13
- Install Python 3.13 from deadsnakes PPA with dev packages
- Set Python 3.13 as default via update-alternatives
- Create venv explicitly with Python 3.13
- Update pyproject.toml to require Python >= 3.13
- Fix line endings in shell scripts (CRLF → LF)

Build process:
1. Adds deadsnakes PPA repository
2. Installs python3.13, python3.13-dev, python3.13-venv, python3.13-distutils
3. Sets as system default Python
4. UV creates venv with Python 3.13
5. All packages install successfully

Tested with FastAPI 0.128.0 - all dependencies working correctly.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-04 11:17:53 -05:00
parent 464f6b3ddb
commit f9762093f8
4 changed files with 31 additions and 8 deletions

View File

@ -27,5 +27,6 @@ RUN mkdir -p /tmp/log/celery && \
chown celery:celery celerybeat-schedule
RUN find . -name "*.sh" -exec chmod +x {} \;
RUN echo $WORKDIR
RUN /bin/bash -c 'source $WORKDIR/docker/pygentic_ai/build.sh'
RUN /bin/bash -c 'source $WORKDIR/docker/pygentic_ai/python_build.sh'
CMD /bin/bash -c 'source $WORKDIR/docker/pygentic_ai/python_start.sh'

View File

@ -3,15 +3,28 @@
export DEBIAN_FRONTEND=noninteractive
export TZ='America/New York'
# Install software-properties-common for add-apt-repository
apt-get update && apt-get upgrade -y
apt-get install openssh-client \
python3-dev \
python3-full \
python3-venv \
python3-pip \
apt-get install -y software-properties-common
# Add deadsnakes PPA for Python 3.13
add-apt-repository -y ppa:deadsnakes/ppa
apt-get update
# Install Python 3.13 and other dependencies
apt-get install -y \
openssh-client \
python3.13 \
python3.13-dev \
python3.13-venv \
python3.13-distutils \
git \
postgresql \
supervisor \
g++ \
gcc \
locales -y
locales
# Set Python 3.13 as the default python3
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.13 1
update-alternatives --set python3 /usr/bin/python3.13

View File

@ -3,8 +3,17 @@
curl -LsSf https://astral.sh/uv/install.sh | sh
PATH="/root/.local/bin/:$PATH"
cd /opt/pygentic_ai || exit
uv venv .venv
# Verify Python version
python3 --version
# Create venv with Python 3.13
uv venv .venv --python python3.13
source .venv/bin/activate
# Verify venv Python version
python --version
for FILE in core_requirements dev_requirements
do
uv pip compile --upgrade $FILE.in -o $FILE.txt

View File

@ -74,7 +74,7 @@ classifiers = [
"Operating System :: OS Independent",
]
version = "1.0.0b0"
requires-python = ">=3.12"
requires-python = ">=3.13"
dependencies = [
"aiofiles>=24.1.0",
"aiomysql>=0.2.0",