Skip to content

chore(docker): upgrade the default Python version from 3.11 to 3.12 - #45183

Open
benispeti wants to merge 1 commit into
apache:masterfrom
benispeti:issue-45063
Open

benispeti wants to merge 1 commit into
apache:masterfrom
benispeti:issue-45063

Conversation

@benispeti

@benispeti benispeti commented Oct 11, 2026 •

Copy link
Copy Markdown

SUMMARY

Update the default production Python base image from python:3.11-slim-trixie to python:3.12-slim-trixie, and align related Docker cache references, CI assertions, and the devcontainer.

A primary motivation is reducing duplicate Python build tools in the production image. The newer setuptools and wheel versions are installed during the build; they are not part of the base image. The attached Syft SBOM comparison shows that the Python 3.11 base image also contributed setuptools 79.0.1 and wheel 0.45.1, duplicating the newer build-installed versions (setuptools 84.0.0 and wheel 0.46.3). The Python 3.12 base image no longer includes those older copies, so the duplicates are absent from its SBOM.

Python 3.11 is scheduled to reach end of life in October 2027, so moving to a supported version is also needed soon. Python 3.12 is supported through October 2028, according to the Python Developer’s Guide.

Removing the duplicate SBOM items also reduce the final size of the default docker image. This can be verified via comparing the size of superset master-py311 and master-py312 docker images.

SBOM evidence:
syft-sbom-superset-py12.txt
syft-sbom-superset-py11.txt

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Not applicable.

TESTING INSTRUCTIONS

  • Build the production image with the default Python version and verify it runs with Python 3.12.
  • Generate a Syft SBOM for the resulting image and compare it with the attached reports to confirm the duplicate base-image copies of setuptools and wheel are absent.
  • Confirm CI’s Docker build command checks pass for the updated default and cache references.

ADDITIONAL INFORMATION

@netlify

netlify Bot commented Oct 11, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 3080b62
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6acb48db7df72c0008bd34e3
😎 Deploy Preview https://deploy-preview-45183--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codeant-ai-for-open-source

codeant-ai-for-open-source Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

CodeAnt  CodeAnt PR Risk

🟢  Low Risk

  • The PR appears safe to merge; no actionable issues were identified in the review.

Assessed commit: 6debb91c0422

Comment thread Dockerfile Resolved
Comment thread .devcontainer/Dockerfile Resolved
@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Oct 26, 2026

@sha174n sha174n left a comment

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.

LGTM — official tag-pinned base image.

run: |
if [ "$INPUT_PYTHON_VERSION" = "current" ]; then
RESOLVED_VERSION="3.11"
RESOLVED_VERSION="3.12"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

scripts/uv-pip-compile.sh reads this current value to pick the Python it resolves requirements/*.txt with, so moving it to 3.12 changes what the lock files should contain. requirements/development.txt:76 still pins backports-tarfile, which jaraco-context only requires on Python < 3.12, so regenerating on 3.12 drops that pin and the check-python-deps job will see a diff. Should the regenerated requirements files be committed in this PR?

run: |
if [ "$INPUT_PYTHON_VERSION" = "current" ]; then
RESOLVED_VERSION="3.11"
RESOLVED_VERSION="3.12"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With current on 3.12 and next on 3.13, no backend unit or integration job runs on 3.11, but requires-python is still >=3.11 and the py311 image is still published. A 3.12-only construct such as itertools.batched would pass CI and then fail for anyone on the supported 3.11 floor. Is there a job that still runs the backend suite on 3.11, or should one be kept in the matrix?

@github-actions github-actions Bot removed the requires:rebase Requires rebasing on top of current master label Oct 28, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.63%. Comparing base (2350348) to head (a7eb574).
⚠️ Report is 208 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #45183      +/-   ##
==========================================
- Coverage   84.63%   84.63%   -0.01%     
==========================================
  Files        3069     3069              
  Lines      205446   205446              
  Branches    48306    48306              
==========================================
- Hits       173879   173873       -6     
- Misses      28277    28283       +6     
  Partials     3290     3290              
Flag Coverage Δ
hive 34.53% <ø> (ø)
javascript 80.80% <ø> (-0.01%) ⬇️
mysql 52.55% <ø> (ø)
postgres 52.56% <ø> (ø)
presto 36.26% <ø> (ø)
python 87.73% <ø> (+<0.01%) ⬆️
sqlite 52.32% <ø> (ø)
unit 82.45% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot added the requires:rebase Requires rebasing on top of current master label Nov 12, 2026

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this @benispeti, and for sticking with it through the review rounds! I think the direction seems right, but a couple of things before this can go in.

GitHub shows conflicts with master now, so this needs a rebase. Heads up that master has since picked up per-platform cache refs (e.g. 3.11-slim-trixie-arm64 in the compose files, plus the assert_platform_cache_refs checks in docker.yml), so those will need the same 3.12 treatment as part of resolving it.

As sadpandajoe flagged above, check-python-deps is failing since moving current to 3.12 drops the backports-tarfile pin. Run ./scripts/uv-pip-compile.sh and commit the result. The question above about keeping a backend job on the 3.11 floor is still open too, and I'd love to see that settled before merging.

Also, would you mind adding a short UPDATING.md note that the default image moves to Python 3.12? Holler if you want a hand with any of it.

@benispeti

Copy link
Copy Markdown
Author

Hi @rusackas! Thanks for the guideance. I've resolved your findings except these two items. I'd appreciate some support from the superset team to resolve them.

As sadpandajoe flagged above, check-python-deps is failing since moving current to 3.12 drops the backports-tarfile pin. Run ./scripts/uv-pip-compile.sh and commit the result. The question above about keeping a backend job on the 3.11 floor is still open too, and I'd love to see that settled before merging.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docker github_actions Pull requests that update GitHub Actions code requires:rebase Requires rebasing on top of current master size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants