fix(snap): install python3-apt as a stage-package instead of building…
Metadata
Current evaluation
Merged PR #2850 as commit e6edb4c6, replacing the incompatible python-apt source build with a dedicated python3-apt stage-package for snap builds.
Resolution: closed resolved
Reason: PR #2850 was merged as commit e6edb4c6. The change installs python3-apt as a stage-package and organizes it into the Charmcraft virtual environment, avoiding uv's rejection of the legacy source archive.
Evaluated by: mr-cal-bot
No scores available.
Issue body
… from source (#2818)
* fix(snap): install python3-apt as a stage-package instead of building from source
uv now rejects source distributions with non-PEP 625-compliant filenames (e.g. python-apt's .tar.xz release from Launchpad), which broke the snap build. Since the snap can't use the prebuilt python-apt wheels (they're built for a different environment), install python3-apt as a distro stage-package in the charmcraft-libs part instead, and organize its files into the charmcraft venv's site-packages.
* fix(tests): resolve ruff lint failures in test suite
Fix 4 ruff errors from the lint job:
- PLR0917 (too many positional args) in tests/conftest.py and tests/unit/commands/test_store.py fixtures/tests, resolved by marking excess parameters as keyword-only since pytest injects fixtures by name.
- ISC004 (unparenthesized implicit string concatenation in a list) in tests/unit/parts/plugins/test_charm.py and test_reactive.py, resolved by wrapping the concatenated string in parentheses.
* refactor(snap): move python3-apt to its own part, matching snapcraft's approach
Mirrors canonical/snapcraft#5872: split python3-apt into a dedicated nil-plugin part with a single glob organize rule, rather than stacking it onto charmcraft-libs with per-file organize entries.
---------
Describe your changes.
---
- [ ] I've followed the [contribution guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md).
- [ ] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [ ] I've successfully run `make lint && make test`.
- [ ] 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 resolved | Merged PR #2850 as commit e6edb4c6, replacing the incompatible python-apt source build with a dedicated python3-apt stage-package for snap builds. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged in #2818 (e6edb4c6): snap builds now use a python3-apt stage-package in a dedicated part, avoiding the rejected source archive and organizing files into the charmcraft venv. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Fixes snap build failures from uv rejecting non-compliant python-apt sources by installing python3-apt as a distro stage-package and isolating it in a dedicated snap part. Also fixes ruff lint errors. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
needs review | Fixes snap build failure by installing python3-apt as a stage-package instead of building from source. Resolves ruff lint errors and refactors snap packaging. Currently awaiting maintainer review with pending CI checks. |
Update history
| Date | Change |
|---|---|
| updated | |
| created |
Related work
-
Related To:
canonical/charmcraft#2818
(confidence 98%)
The implementation tracks the snap-build failure and fix in #2818; commit e6edb4c6 references it.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2818 fix(snap): install python3-apt as a stage-package instead of building from source | charmcraft | merged | Merged PR canonical/charmcraft#2818 by lengau: snap build no longer builds python-apt from source via uv; python3-apt added to charmcraft-libs stage-packages and organized into the venv site-packages. Removed requirements-noble.txt and libapt-pkg-dev. | |
| #6382 fix(snap): remove libapt-pkg-dev and stale comment now that python3-apt is a stage-package | snapcraft | closed | Merged canonical/snapcraft#6382, removing obsolete libapt-pkg-dev from snap build dependencies and correcting the stale python-apt source-build comment. | |
| #6383 fix(snap): remove libapt-pkg-dev now that python3-apt is a stage-package | snapcraft | closed | PR #6383 was merged, dropping the redundant libapt-pkg-dev build-package from snap/snapcraft.yaml now that python3-apt is installed via stage-packages, and refreshing the stale MAKEOPTS comment. | |
| #401 fix(snap): install python3-apt as a stage-package instead of building from source | imagecraft | closed | Closed unmerged. Copilot's port of charmcraft#2818 (python3-apt as a stage-package instead of a rejected .tar.xz source build) was dismissed by @lengau as "not enough of a change to bother"; no code landed in imagecraft. | |
| #3236 snap: use python3-apt stage-package | snapcraft | closed | PR #3236 was closed unmerged after years with review pending and no CI or comments; the proposed switch from pip to the python3-apt stage package was not applied. |