← Back to issue list

Poetry plugin fails on 20.04 base

View original Github issue

Metadata

Project
charmcraft
Number
#1996
Type
issue
State
closed
Author
carlcsaposs-canonical
Labels
—
Created
Updated
Closed

Current evaluation

Poetry plugin added python3-poetry-plugin-export to apt build-packages, unavailable on Ubuntu 20.04. Fixed upstream in craft-parts PR #1633 (commit cff4121b/fbe33c05); issue closed after upstream fix.

Resolution: closed resolved

Reason: Maintainer lengau linked an upstream fix; craft-parts PR #1633 'fix(poetry): don't install the export plugin from apt' was merged (commits cff4121b / fbe33c05), removing the apt-based export plugin install that failed on 20.04.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description Poetry plugin fails on 20.04 base, even if installing new version of poetry manually ### To Reproduce ``` git clone https://github.com/canonical/pgbouncer-operator cd pgbouncer-operator git checkout 6b6a46ca48200dce2ad4fa9d11c3a8b63458cce1 charmcraft pack -v ``` ``` Starting charmcraft, version 3.2.2.post75+gff00a899 Logging execution to '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20241115-131317.698225.log' Launching managed ubuntu 20.04 instance... Creating instance from base instance Starting instance Starting charmcraft, version 3.2.2.post75+gff00a899 Logging execution to '/tmp/charmcraft.log' Starting charmcraft, version 3.2.2.post75+gff00a899 Logging execution to '/tmp/charmcraft.log' Initialising lifecycle Installing build-packages Cannot find package listed in 'build-packages': python3-poetry Failed to execute charmcraft in instance. Full execution log: '/home/ubuntu/.local/state/charmcraft/log/charmcraft-20241115-131317.698225.log' ``` ### Environment Ubuntu 22.04 ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 3.2.2.post75+gff00a899 5394 3.x/edge canonical✓ classic,held core18 20240920 2846 latest/stable canonical✓ base core20 20240911 2434 latest/stable canonical✓ base core22 20241001 1663 latest/stable canonical✓ base juju 3.5.4 28520 3/stable canonical✓ - lxd 5.0.3-80aeff7 29351 5.0/stable/… canonical✓ - microk8s v1.29.9 7227 1.29-strict/stable canonical✓ - snapd 2.63 21759 latest/stable canonical✓ snapd ``` ### charmcraft.yaml ```yaml # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. type: charm bases: - name: ubuntu channel: "20.04" architectures: [amd64] - name: ubuntu channel: "20.04" architectures: [arm64] - name: ubuntu channel: "22.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [arm64] parts: poetry-deps: plugin: nil build-packages: - curl override-build: | python3 -m pip install --upgrade pip==24.3.1 curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 ln -sf $HOME/.local/bin/poetry /usr/local/bin/poetry foo: plugin: poetry source: . after: - poetry-deps poetry-with: - charm-libs build-snaps: - rustup build-packages: - libffi-dev - libssl-dev - pkg-config override-build: | rustup default stable craftctl default libpq: build-packages: - libpq-dev plugin: dump source: /usr/lib/ source-type: local prime: - lib/ organize: "*-linux-gnu/libpq.so*": lib/ ``` ### Relevant log output [charmcraft-20241115-131317.698225.log](https://github.com/user-attachments/files/17775955/charmcraft-20241115-131317.698225.log)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Poetry plugin added python3-poetry-plugin-export to apt build-packages, unavailable on Ubuntu 20.04. Fixed upstream in craft-parts PR #1633 (commit cff4121b/fbe33c05); issue closed after upstream fix.
stealth/space-bunny-alpha — closed resolved Fixed upstream by craft-parts PR #1633 (commit fbe33c05): the Poetry plugin no longer adds its export plugin through apt, fixing builds on Ubuntu 20.04.
qwen3.6-35b-a3b-mtp-q6 — — Poetry plugin failed on Ubuntu 20.04 due to missing python3-poetry package. Resolved via an upstream craft-parts pull request addressing the package lookup logic. Closed as fixed.
qwen/qwen3.6-35b-a3b — — Fixed via an upstream pull request to craft-parts that resolves the missing python3-poetry package error when using the Poetry plugin on Ubuntu 20.04 bases.
qwen/qwen3.6-35b-a3b — — Fixed by an upstream craft-parts pull request that resolves the missing python3-poetry dependency causing failures on Ubuntu 20.04 bases.
qwen3.6-35b-a3b-mtp-q6 — — Fixed via an upstream craft-parts pull request that resolves the missing python3-poetry dependency causing the Poetry plugin to fail on Ubuntu 20.04 bases.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: craft-parts#1633 (confidence 95%)

    Upstream fix removing apt-based poetry export plugin install, cited by lengau in the issue comments

  • Related To: craft-parts#1510 (confidence 70%)

    Earlier PR adding conditional python3-poetry-plugin-export install for 25.04+, later refined/removed by #1633

Related issues

Issue Project State Summary Similarity
#1492 Fix poetry plugin for 25.04+ craft-parts closed Craft-parts fixed Poetry 2 export compatibility by conditionally installing python3-poetry-plugin-export on Ubuntu 25.04+ in PR #1510 (commit 6d30ef14).
82%
#1510 fix(poetry): install export plugin on 25.04+ craft-parts merged Merged PR #1510 in commit 6d30ef14, adding python3-poetry-plugin-export on Ubuntu 25.04+ to preserve Poetry's export functionality.
77%
#901 fix(poetry): don't install poetry with poetry-deps craft-parts merged PR #901 merged as commit 2eda2a5a: the Poetry plugin skips adding python3-poetry (and the export plugin) to build packages when a poetry-deps part supplies them. Fixes charmcraft#1996 (CRAFT-3687); noted in the 2.34.1 changelog.
75%
#5962 Update Poetry version snapcraft closed No Poetry upgrade was made. Maintainer bepri explained the plugin uses the base core's python3-poetry version (not changeable) and suggested overriding it or adding python3-poetry-plugin-export; reporter moved to uv and stopped testing, so the issue was closed.
72%
#707 `poetry` Python plugin craft-parts closed Poetry plugin feature request implemented: PR #820 ("feat(plugin): add poetry plugin", commit 8b0d76c8) merged, later documented in #830 and fixed in #960. Issue closed by mr-cal on 2025-07-09 with "Completed via #820".
70%
#5025 Enable the poetry plugin snapcraft closed Poetry source support delivered by merged PR canonical/snapcraft#5090 (commit 5a42f0aa5), adding a Snapcraft-specific Poetry plugin for core22/core24, closing the request. Tracked internally as CRAFT-3363.
70%