Skip to content

fix(docker): pin Poetry to 2.2.1 for Python 3.9 compatibility#8735

Merged
ewega merged 1 commit intoapache:mainfrom
bonial-oss:rodrigo/fix/pin-poetry-version
Mar 30, 2026
Merged

fix(docker): pin Poetry to 2.2.1 for Python 3.9 compatibility#8735
ewega merged 1 commit intoapache:mainfrom
bonial-oss:rodrigo/fix/pin-poetry-version

Conversation

@rodrigoluizs
Copy link
Copy Markdown
Contributor

@rodrigoluizs rodrigoluizs commented Feb 27, 2026

Title: fix(docker): pin Poetry to 2.2.1 for Python 3.9 compatibility

Base: main (apache/incubator-devlake)


Summary

The backend/Dockerfile installs Poetry without pinning a version:

RUN curl -sSL https://install.python-poetry.org | python3 -

Poetry 2.3.0 dropped support for Python 3.9. Since the base image uses python:3.9-slim-bookworm, the unpinned installer now fetches an incompatible version (currently 2.3.2), causing the build to fail when there is no Docker layer cache available.

Reference: https://python-poetry.org/blog/announcing-poetry-2.3.0/

Current CI builds succeed only because the cached devlake:base image still contains a Poetry layer from a previous compatible version. Any cache invalidation (base image security update, forced rebuild, new registry) will break the build with:

Installing Poetry (2.3.2): An error occurred. Removing partial environment.
Poetry installation failed.

This PR pins Poetry to 2.2.1, the last release compatible with Python 3.9.

Does this close any open issues?

Closes #8734

Screenshots

N/A

Other Information

An alternative approach would be to upgrade the base image to Python 3.10+ to support Poetry 2.3+, but that has a larger blast radius.

Poetry 2.3.0 dropped Python 3.9 support. Without cache the installer
fetches the latest version (currently 2.3.2), which fails on the
python:3.9-slim-bookworm base image. Pin to 2.2.1, the last release
compatible with Python 3.9.
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. devops Something about CI/CD (devops) pr-type/bug-fix This PR fixes a bug labels Feb 27, 2026
@ewega ewega self-assigned this Mar 24, 2026
@ewega ewega requested a review from Copilot March 25, 2026 20:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Pins Poetry in backend/Dockerfile to a Python 3.9–compatible release so Docker builds don’t break when the Poetry installer fetches a newer incompatible version.

Changes:

  • Pin Poetry installation to 2.2.1 via the official installer to retain Python 3.9 compatibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ewega ewega self-requested a review March 30, 2026 17:20
Copy link
Copy Markdown
Contributor

@ewega ewega left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution. I had the same issue while testing. Looks good 👍🏾

@ewega ewega merged commit 887257b into apache:main Mar 30, 2026
14 checks passed
la-tamas pushed a commit to archfz/incubator-devlake that referenced this pull request Apr 9, 2026
…#8735)

Poetry 2.3.0 dropped Python 3.9 support. Without cache the installer
fetches the latest version (currently 2.3.2), which fails on the
python:3.9-slim-bookworm base image. Pin to 2.2.1, the last release
compatible with Python 3.9.

Co-authored-by: Rodrigo Silva <rodrigo.silva@bonial.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devops Something about CI/CD (devops) pr-type/bug-fix This PR fixes a bug size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][docker] Poetry installation fails without cache due to Python 3.9 incompatibility

3 participants