Skip to content

Remove python3-debian12 and cleanup readmes#2084

Merged
loosebazooka merged 1 commit into
mainfrom
deprecate-python3-debian12
May 12, 2026
Merged

Remove python3-debian12 and cleanup readmes#2084
loosebazooka merged 1 commit into
mainfrom
deprecate-python3-debian12

Conversation

@loosebazooka
Copy link
Copy Markdown
Member

@loosebazooka loosebazooka commented May 11, 2026

As per our SUPPORT_POLICY.md. Python3 for debian12 is deprecated.

@loosebazooka loosebazooka requested a review from patflynn May 11, 2026 20:09
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

🌳 🔧 Config Check

This pull request has modified the root BUILD

--- /dev/fd/63	2026-05-12 14:53:59.354488139 +0000
+++ /dev/fd/62	2026-05-12 14:53:59.354488139 +0000
@@ -518,18 +518,6 @@
 {REGISTRY}/{PROJECT_ID}/nodejs24:nonroot-arm64 //nodejs:nodejs24_nonroot_arm64_debian13
 {REGISTRY}/{PROJECT_ID}/nodejs24:nonroot-ppc64le //nodejs:nodejs24_nonroot_ppc64le_debian13
 {REGISTRY}/{PROJECT_ID}/nodejs24:nonroot-s390x //nodejs:nodejs24_nonroot_s390x_debian13
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug //python3:python3_debug_root_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug-amd64 //python3:python3_debug_root_amd64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug-arm64 //python3:python3_debug_root_arm64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug-nonroot //python3:python3_debug_nonroot_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug-nonroot-amd64 //python3:python3_debug_nonroot_amd64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:debug-nonroot-arm64 //python3:python3_debug_nonroot_arm64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:latest //python3:python3_root_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:latest-amd64 //python3:python3_root_amd64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:latest-arm64 //python3:python3_root_arm64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:nonroot //python3:python3_nonroot_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:nonroot-amd64 //python3:python3_nonroot_amd64_debian12
-{REGISTRY}/{PROJECT_ID}/python3-debian12:nonroot-arm64 //python3:python3_nonroot_arm64_debian12
 {REGISTRY}/{PROJECT_ID}/python3-debian13:debug //python3:python3_debug_root_debian13
 {REGISTRY}/{PROJECT_ID}/python3-debian13:debug-amd64 //python3:python3_debug_root_amd64_debian13
 {REGISTRY}/{PROJECT_ID}/python3-debian13:debug-arm64 //python3:python3_debug_root_arm64_debian13

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the distroless Python images from Debian 12 (Python 3.11) to Debian 13 (Python 3.13), updating Bazel configurations, documentation, and examples accordingly. Feedback focuses on ensuring ABI compatibility in the provided Dockerfile examples by using a Python 3.13-based build image instead of the default Debian 13 slim image, which currently defaults to Python 3.11. There is also a suggestion to simplify the README now that only a single Python version is supported.

Comment thread examples/python3-requirements/Dockerfile Outdated
Comment thread examples/python3-requirements/Dockerfile Outdated
Comment thread python3/README.md Outdated
@loosebazooka loosebazooka force-pushed the deprecate-python3-debian12 branch 3 times, most recently from 98a9b0b to eb42fcc Compare May 11, 2026 20:52
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

🌳 🔄 Image Check
This pull request doesn't make any changes to the images. 👍
You can check the details in the report here

Signed-off-by: Appu <appu@google.com>
@loosebazooka loosebazooka force-pushed the deprecate-python3-debian12 branch from eb42fcc to 22b97d1 Compare May 12, 2026 14:53
@loosebazooka
Copy link
Copy Markdown
Member Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the default distroless images and Python runtime from Debian 12 (bookworm) to Debian 13 (trixie). Key changes include updating primary image references in the documentation and examples, removing Debian 12 configurations from the Python 3 build logic, and updating the Python 3 requirements example to use a compatible trixie-based build image. The Python 3 documentation has also been expanded with a compatibility section addressing ABI and pathing requirements for multi-stage builds. I have no feedback to provide as there were no review comments.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request transitions the distroless Python images from Debian 12 to Debian 13, updating the default Python version to 3.13 and removing support for the previous version. Documentation, build configurations, and examples have been updated to reflect this change. The reviewer suggested an optimization for the Python requirements example to reduce image size by cleaning up the package manager cache.

Comment on lines 5 to 12
RUN apt-get update && \
apt-get install --no-install-suggests --no-install-recommends --yes python3-venv gcc libpython3-dev && \
python3 -m venv /venv && \
apt-get install --no-install-suggests --no-install-recommends --yes gcc libc6-dev && \
# Symlink the distroless path for python: /usr/bin/python to the build
# image path: /usr/local/bin/python to ensure the runtime image's venv has
# the right python paths.
ln -s /usr/local/bin/python /usr/bin/python && \
/usr/bin/python -m venv /venv && \
/venv/bin/pip install --upgrade pip setuptools wheel
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To reduce the size of this build layer, it's a good practice to clean up the apt cache after installing packages. You can do this by adding && rm -rf /var/lib/apt/lists/* to the end of your RUN command.

RUN apt-get update && \
    apt-get install --no-install-suggests --no-install-recommends --yes gcc libc6-dev && \
    # Symlink the distroless path for python: /usr/bin/python to the build 
    # image path: /usr/local/bin/python to ensure the runtime image's venv has
    # the right python paths.
    ln -s /usr/local/bin/python /usr/bin/python && \
    /usr/bin/python -m venv /venv && \
    /venv/bin/pip install --upgrade pip setuptools wheel && \
    rm -rf /var/lib/apt/lists/*

@loosebazooka loosebazooka merged commit 62694fb into main May 12, 2026
14 checks passed
@loosebazooka loosebazooka deleted the deprecate-python3-debian12 branch May 12, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants