fix(snap): install python3-apt as a stage-package instead of building from source
Metadata
Current evaluation
Merged. Fixed snap build failures from uv rejecting non-PEP 625-compliant python-apt sources by installing python3-apt as an apt stage-package instead of compiling from source. Removed requirements-noble.txt and updated snapcraft configuration.
Suggested action: —
No scores available.
Issue body
## Problem
The snap build fails with the current `uv` version:
\`\`\`
error: Source distribution
\`https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.7.7ubuntu5/python-apt_2.7.7ubuntu5.tar.xz\`
has a non-PEP 625-compliant filename; only \`.tar.gz\` and \`.zip\` archives are accepted
\`\`\`
`uv` now hard-rejects source distributions whose filenames aren't PEP 625
compliant (only `.tar.gz`/`.zip`), and Launchpad only serves the
`python-apt` source tarball as `.tar.xz`. There's no `uv` flag to bypass
this check, so `requirements-noble.txt` (installed via `uv pip install`
in the snap's `override-build`) can no longer be used.
We also can't switch to the prebuilt `python-apt` wheels used for local
dev (`python-apt-wheels` index in `pyproject.toml`), since the snap is
built with `PIP_NO_BINARY`/`UV_NO_BINARY` set to force building
everything from source (to avoid issues like #1369), and those wheels
aren't built in a way that's safe to ship in the snap.
## Fix
Install `python3-apt` as a normal apt stage-package in the
`charmcraft-libs` part (alongside its shared library and other runtime
deps, resolved automatically by snapcraft), and `organize` its files into
the charmcraft venv's `site-packages`, instead of trying to `pip`/`uv`
install it from source. This sidesteps the PEP 625 restriction entirely
and avoids compiling `python-apt` at build time.
- Removed `requirements-noble.txt` and the `uv pip install -r
requirements-noble.txt` step from `snap/snapcraft.yaml`.
- Added `python3-apt` to `charmcraft-libs` stage-packages, with an
`organize` mapping (using globs for the arch/version-specific `.so`
files) into `lib/python3.12/site-packages/`.
- Dropped the now-unneeded `libapt-pkg-dev` build-package (only needed
for compiling `python-apt` from source).
- Updated a stale comment in `.github/workflows/policy.yaml` referencing
the removed `requirements-noble.txt`.
## Testing
- Built the snap locally with `snapcraft_edge pack --platform amd64`:
succeeds.
- Installed the resulting snap and confirmed `apt`/`apt_pkg`/`apt_inst`/
`aptsources` are present under `lib/python3.12/site-packages` and
importable, and `charmcraft --version` works.
- Running the full `spread -reuse -resend multipass:` suite to confirm
no regressions before taking this out of draft.
Marking as **draft** until the full spread suite finishes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged. Fixed snap build failures from uv rejecting non-PEP 625-compliant python-apt sources by installing python3-apt as an apt stage-package instead of compiling from source. Removed requirements-noble.txt and updated snapcraft configuration. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged. Fixes snap build failures caused by uv rejecting non-PEP 625-compliant python-apt source tarballs. Replaces source compilation with an apt stage-package installation, removing requirements-noble.txt and build dependencies. CI passed. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
80
|
needs review | Fixes snap build failure by installing python3-apt as an apt stage-package instead of building from source, bypassing uv's PEP 625 restriction. Currently approved by 2 reviewers but marked as draft pending full spread test suite results. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
85
|
keep open | Fixes snap build failure caused by uv rejecting non-PEP 625 compliant source tarballs by installing python3-apt as an apt stage-package instead of building from source. Currently in draft pending spread test results. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
keep open | Replaces building python3-apt from source with an apt stage-package to bypass uv's PEP 625 filename restriction. Currently marked draft pending full spread test suite completion. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
20
Confidence:
85
|
keep open | Switches snap build to install python3-apt as an apt stage-package instead of building from source via uv, fixing a PEP 625 filename rejection error. Currently marked draft pending CI and review. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
40
Confidence:
85
|
keep open | Fixes snap build failure caused by uv rejecting non-PEP 625 compliant python-apt source tarballs by installing python3-apt as an apt stage-package instead of building from source. Currently marked as draft pending full test suite results. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
30
Confidence:
85
|
keep open | Replaces python-apt source build with apt stage-package to resolve uv PEP 625 compliance failure. Currently draft, awaiting full test suite results and maintainer review. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
0
Complexity:
30
Confidence:
90
|
keep open | Fixes snap build failure caused by uv rejecting python-apt source tarballs by installing python3-apt as an apt stage-package instead of building from source. Currently marked as draft pending completion of the spread test suite. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
45
Confidence:
85
|
keep open | Changes snapcraft.yaml to install python3-apt as an apt stage-package instead of building from source via uv, fixing PEP 625 compliance failures. Currently marked as draft pending CI spread suite results. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
35
Confidence:
85
|
keep open | Fixes snap build failure by installing python3-apt as an apt stage-package instead of building from source via uv. Currently marked as draft pending full test suite results. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
85
|
keep open | Switches snap build to install python3-apt as an apt stage-package instead of building from source, resolving uv PEP 625 compliance failures. Currently marked as draft pending full test suite. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
5
Complexity:
15
Confidence:
90
|
keep open | Fixes snap build failure caused by uv rejecting python-apt source tarballs by installing python3-apt as an apt stage-package instead of building from source. Currently marked draft pending CI spread suite. |
Update history
| Date | Change |
|---|---|
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2850 fix(snap): install python3-apt as a stage-package instead of building… | charmcraft | merged | 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. | |
| #6383 fix(snap): remove libapt-pkg-dev now that python3-apt is a stage-package | snapcraft | closed | Merged a fix to remove redundant libapt-pkg-dev from snapcraft build dependencies, resolving uv source distribution build failures by relying on the python3-apt stage-package. | |
| #401 fix(snap): install python3-apt as a stage-package instead of building from source | imagecraft | closed | Closed and rejected without merging. A maintainer dismissed the snap fix to stage python3-apt instead of building from source as insufficiently impactful. | |
| #3394 requirements: rely on host's python3-apt | snapcraft | closed | Merged into master. Updates snapcraft to use the host's python3-apt, removes it from requirements.txt, and fixes a snap command entry warning. | |
| #6382 fix(snap): remove libapt-pkg-dev and stale comment now that python3-apt is a stage-package | snapcraft | closed | Merged to remove the unused libapt-pkg-dev build dependency and update a stale comment, reflecting the switch to python3-apt as a stage-package. |