Skip to content

fix: Correctly use Python 3.13 in Docker image #2059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

adamantike
Copy link
Contributor

Description
The production-stage stage was depending on the python3 package from Alpine, which at the moment of writing is still Python 3.12.

To avoid relying on Alpine's package and releases, we now copy the Python installation directly from its official Docker image.

Other options were tested but did not work:

  • Trying to install Python 3.13 using apk. As mentioned, Alpine does not support Python 3.13 yet.
  • Installing Python 3.13 using pyenv. The installation worked, but the generated image was too large. Related pyenv discussion: https://github.com/orgs/pyenv/discussions/2868
  • Installing Python 3.13 using uv. Only worked for amd64 architecture, but the installation failed on arm64.

Checklist

  • I've tested the changes locally
  • I've updated relevant comments
  • I've assigned reviewers for this PR
  • I've added unit tests that cover the changes

@adamantike adamantike requested review from gantoine and zurdi15 July 7, 2025 03:06
Copy link

trunk-io bot commented Jul 7, 2025

Running Code Quality on PRs by uploading data to Trunk will soon be removed. You can still run checks on your PRs using trunk-action - see the migration guide for more information.

The `production-stage` stage was depending on the `python3` package from
Alpine, which at the moment of writing is still Python 3.12.

To avoid relying on Alpine's package and releases, we now copy the
Python installation directly from its official Docker image.

Other options were tested but did not work:
- Trying to install Python 3.13 using `apk`. As mentioned, Alpine does
  not support Python 3.13 yet.
- Installing Python 3.13 using `pyenv`. The installation worked, but the
  generated image was too large. Related `pyenv` discussion:
  https://github.com/orgs/pyenv/discussions/2868
- Installing Python 3.13 using `uv`. Only worked for `amd64`
  architecture, but the installation failed on `arm64`.
@adamantike adamantike force-pushed the fix/python-3.13-installation branch from f508ba9 to 87d20b0 Compare July 7, 2025 03:17
Copy link
Member

@gantoine gantoine left a comment

Choose a reason for hiding this comment

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

yooooo this solution is great, wouldnt have thought of it lol

@adamantike adamantike merged commit 2da7b98 into master Jul 7, 2025
7 checks passed
@adamantike adamantike deleted the fix/python-3.13-installation branch July 7, 2025 03:34
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