← Back to issue list

Flask extension. Allow charm-libs to be extended by the user

View original Github issue

Metadata

Project
charmcraft
Number
#1718
Type
pull request
State
merged
Author
javierdelapuente
Labels
—
Created
Updated
Closed

Current evaluation

PR #1718 merged as commit 4ff7cee3, fixing the Flask extension so a user-defined charm-libs list in charmcraft.yaml is merged with the extension's _CHARM_LIBS instead of raising AttributeError.

Resolution: closed resolved

Reason: Merged into main as commit 4ff7cee3 ('Flask extension. Allow charm-libs to be extended by the user (#1718)'). The extension now exposes _CHARM_LIBS in its root snippet and the merge concatenates both lists (deduplicated); tests/extensions/test_app.py::test_flask_merge_charm_libs asserts applied['charm-libs'] == [*FlaskFrameworkV1._CHARM_LIBS, *added_charm_libs]. Approved by @lengau on 2024-07-16.

Evaluated by: mr-cal-bot

No scores available.

Issue body

As pointed by @mr-cal in https://github.com/canonical/charmcraft/pull/1691#pullrequestreview-2156902965, the Flask extension fails when a `charm-libs` is already defined in a `charmcraft.yaml`, with a not very clear message because of an `AttributeError` exception. This PR allows having a `charm-libs` in the original `charmcraft.yaml`, and will combine both `charm-libs` lists (if there are duplicated elements they will be only downloaded once).

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #1718 merged as commit 4ff7cee3, fixing the Flask extension so a user-defined charm-libs list in charmcraft.yaml is merged with the extension's _CHARM_LIBS instead of raising AttributeError.
stealth/space-bunny-alpha — closed resolved Merged PR #1718 as commit 4ff7cee3, fixing Flask's AttributeError when charmcraft.yaml already defines charm-libs by combining extension and user lists and deduplicating entries.
qwen/qwen3.6-35b-a3b — — Merged. Resolves Flask extension AttributeError when charm-libs is pre-defined in charmcraft.yaml. Combines and deduplicates charm-libs from both extension and user configs. Approved and passed CI.
qwen3.6-35b-a3b-mtp-q6 — — Merged. Fixes a Flask extension AttributeError when charm-libs is pre-defined in charmcraft.yaml. The change combines and deduplicates charm-libs from both the extension and user configuration. Approved and merged by maintainers.

Update history

No update history recorded yet.

Related work

  • Caused By: canonical/charmcraft#1691 (confidence 92%)

    The Flask/Django extension update (commit 775a0fc7) that introduced the AttributeError when charm-libs was already defined; flagged in @mr-cal's review comment on that PR.

  • Related To: canonical/charmcraft#1955 (confidence 45%)

    Later commit 31418c9c 'fix(charm-libs): better error message on bad version type' touches the same charm-libs feature area.

Related issues

Issue Project State Summary Similarity
#1582 Add the `flask-framework` extension charmcraft merged Merged the flask-framework extension and init profile into Charmcraft via PR #1582 (commit c060832a), including a fix to skip tox testing when no tox.ini is generated.
71%
#2556 fix: charmcraft templates for flask and django extensions charmcraft merged Merged #2556 added the missing platforms key to Charmcraft YAML templates for Flask and Django 12-factor extensions.
71%
#1743 flask-framework charm builds failing due to dependency charmcraft closed Flask-framework builds were fixed by merged PR #1751 (40beeef3), which gave the extension a default Rust version and resolved the indirect rustc dependency failure.
70%