← Back to issue list

feat!: replace OsRelease with distro

View original Github issue

Metadata

Project
craft-parts
Number
#1742
Type
pull request
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Replaces the public OsRelease wrapper with distro across chroot checks, platform detection, Poetry, and tests. Open with lint/files and both minimum-dependency jobs failing; eight checks remain pending.

Suggested action: keep open

Reason: Keep open because CI is not merge-ready: lint / files and both Minimum dependencies jobs are failing, with eight additional jobs pending and no reviewer approval. The sole review thread reports that Copilot findings were addressed in c091217, but the red dependency jobs and unfinished matrix need resolution before final review.

Evaluated by: mr-cal-bot

Impact: 59 Quick Win: 8 Complexity: 61 Confidence: 90 Actionability: 35

Issue body

BREAKING CHANGE: remove `craft_parts.utils.os_utils.OsRelease`; callers must use `distro` package directly (`distro.id()`, `distro.name()`, `distro.version()` and `distro.LinuxDistribution` for chroot files). Adds `distro>=1.8` dependency. - Replace `OsRelease` wrapper with `distro` in `overlays/chroot.py` (host vs chroot comparison via `distro.LinuxDistribution(..., include_lsb=False)`), `packages/platform.py` and `plugins/poetry_plugin.py` (Ubuntu 25.04 check) - Delete `OsRelease` class from `craft_parts/utils/os_utils.py` (do not use `platform.freedesktop_os_release` – it lacks `os_release_file` support needed in chroot) - Update tests: delete `TestOsRelease` in `tests/unit/utils/test_os_utils.py`, patch `distro` instead of `OsRelease` in `test_platform`/`test_poetry_plugin`/`test_maven_use` and integration tests - Keep diff minimal; no change to `craft-providers`/`charmcraft` divergence Closes #1333 / CRAFT-4800 Verification: - `uv run python -c "import distro; print(distro.id())"` - `uv run pytest tests/unit/utils/test_os_utils.py tests/unit/packages/test_platform.py tests/unit/plugins/test_poetry_plugin.py` → pass - `uv run ruff check craft_parts` → pass - `uv lock --check` → pass

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 59
Quick Win: 8
Complexity: 61
Confidence: 90
Actionability: 35
keep open Replaces the public OsRelease wrapper with distro across chroot checks, platform detection, Poetry, and tests. Open with lint/files and both minimum-dependency jobs failing; eight checks remain pending.
stealth/space-bunny-alpha
Impact: 45
Quick Win: 8
Complexity: 50
Confidence: 72
Actionability: 35
needs review Maintainer PR removing craft_parts OsRelease in favor of the distro package (chroot, platform, poetry plugin), adds distro>=1.8, Closes #1333/CRAFT-4800. No reviewers; lint and both Minimum-dependencies CI jobs failing.
stealth/space-bunny-alpha
Impact: 52
Quick Win: 17
Complexity: 45
Confidence: 58
Actionability: 58
needs review Maintainer PR (age 0d) removing craft_parts OsRelease in favor of the distro package in chroot overlays, platform detection and the poetry plugin; deletes the class and its tests, adds distro>=1.8. Closes #1333/CRAFT-4800. Pending review, 0 reviewers, 10 unresolved bot comments.
stealth/space-bunny-alpha
Impact: 50
Quick Win: 14
Complexity: 40
Confidence: 58
Actionability: 48
needs review Breaking: removes craft_parts.utils.os_utils.OsRelease in favor of the distro package (overlays/chroot.py, packages/platform.py, poetry plugin), adding distro>=1.8. Author addressed Copilot feedback in c091217; 10 unresolved comments, no approvals yet.
stealth/space-bunny-alpha
Impact: 55
Quick Win: 9
Complexity: 52
Confidence: 86
Actionability: 35
needs review Maintainer migration replaces public OsRelease with distro>=1.8 in chroot, platform, and Poetry code. The 16-file change awaits review, with 10 unresolved comments, three failing CI jobs, and many checks pending.

Update history

Date Change
updated
updated
created

Related work

  • Related To: craft-parts#1333 (confidence 100%)

    The PR explicitly targets the open issue about consolidating os-release utilities.

  • Related To: craft-archives#59 (confidence 96%)

    Merged counterpart made the same move from a hand-written parser to distro, supporting the approach without superseding this PR.

Related issues

Issue Project State Summary Similarity
#1581 feat: deprecate OsRelease in favor of distro craft-parts open Deprecates os_utils.OsRelease in favor of the distro PyPI package across 18 files (+179/-132). Approved by 1 reviewer, but 3 unresolved review comments and 19 failing checks; no author activity for 128 days.
70%