feat: use uv for 12-factor charms
Metadata
Current evaluation
PR #2714 was closed unmerged after 115+ days without activity or review; the proposed 12-factor uv-plugin migration was abandoned.
Resolution: closed stale
Reason: Review remained pending with zero reviewers and multiple CI checks failing, while later app.py history contains no #2714 merge commit. No closing comment documents a resolution or replacement.
Evaluated by: mr-cal-bot
No scores available.
Issue body
## Summary
Switch the 12-factor app extensions (Flask, Django, FastAPI, Go, Spring Boot, and the shared `_AppBase`) from the `charm` plugin to the `uv` plugin for building Python charms.
## What changed
**`charmcraft/extensions/app.py`**
- `_AppBase._get_charm_part()` — replaces `plugin: charm` with `plugin: uv` and swaps `build-snaps: [rustup]` + the `override-build` rustup-init script for `build-snaps: [astral-uv, rustup]`. The `astral-uv` snap provides the `uv` tool that the `uv` plugin expects; `rustup` remains to satisfy pydantic compilation.
- `_AppBase.get_supported_bases()` — now returns both `ubuntu@22.04` and `ubuntu@24.04`. Previously only 22.04 was listed, but the `charmcraft init` templates generate `base: ubuntu@24.04`. This caused CI to reject the extension with "does not support base(s): ubuntu@24.04" after PR #2713 made base validation strict.
- `SpringBootFramework.is_experimental()` — adds an explicit `is_experimental` override that returns `False`, making it clear this extension is production-ready and consistent with the other frameworks.
**`tests/extensions/test_app.py`**
Updated all expected `charm` part fixtures to match the new `uv` plugin shape (no `override-build`, both snaps listed).
## Why
The `uv` plugin is the recommended way to install Python dependencies in modern charms. It:
- Reads `pyproject.toml` or `requirements.txt` and installs deps via `uv sync` / `uv pip install`
- Is faster and more reproducible than pip-based installs done in `override-build`
- Avoids the bespoke `rustup default stable && craftctl default` override-build script
The `charm` plugin is a legacy build path. Switching to `uv` aligns 12-factor charms with the current recommended charm development workflow.
## Testing
- Unit tests: `make test` (all 2539 pass)
- Snap tests: covered by CI via `charmcraft init --profile django-framework` + `charmcraft fetch-libs` on Ubuntu 20.04 and 22.04 spread nodes
## Related
- Depends on PR #2713 (`feat(extensions): make extensions work with base`) which is now merged to main.
- Trivy security scan failure (Django 5.1.4 in `docs/tutorial/code/django/requirements.txt`) is pre-existing and unrelated to this change.
---
- [x] I've followed the [contribution guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md).
- [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [x] I've successfully run `make lint && make test`.
- [x] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed stale | PR #2714 was closed unmerged after 115+ days without activity or review; the proposed 12-factor uv-plugin migration was abandoned. | |
| stealth/space-bunny-alpha | — | closed stale | Closed unmerged after 107 days without review; app extensions still use the charm plugin, while lint/files and snap-build checks were failing. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without merging. The proposed switch from the legacy charm plugin to the uv plugin for 12-factor extensions was abandoned due to failing CI checks on older Ubuntu bases and lint/security scans, with no reviewer engagement. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Switched 12-factor charm extensions from the legacy charm plugin to the uv plugin for faster Python dependency management. Added Ubuntu 24.04 base support, fixed the SpringBoot experimental flag, and updated test fixtures. |
Update history
No update history recorded yet.
Related work
-
Related To:
charmcraft#2713
(confidence 100%)
The PR explicitly depended on #2713, which introduced stricter base validation and was merged.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #695 feat: uv python plugin | craft-parts | closed | PR #695 was closed unmerged after 605 days of inactivity, with no reviewers, comments, CI runs, or merge commit recorded. | |
| #2050 feat: add uv plugin to charmcraft | charmcraft | merged | Merged PR #2050 as commit 6d0d9ce4, adding uv plugin support to Charmcraft and closing #2040 after prerequisite craft-parts#945. |