feat: unified package model with idempotent upgrades across all package managers#1594
Draft
wowi42 wants to merge 5 commits intopyinfra-dev:3.xfrom
Draft
feat: unified package model with idempotent upgrades across all package managers#1594wowi42 wants to merge 5 commits intopyinfra-dev:3.xfrom
wowi42 wants to merge 5 commits intopyinfra-dev:3.xfrom
Conversation
…ge managers Introduce a common PackageInfo data model (name, version, status) and build_package_map() helper so all package managers share a consistent representation of installed, upgradeable, and held packages. Operations like upgrade() are now idempotent — they check for available upgrades before running. The ensure_packages() function accepts both the old dict[str, set[str]] and new dict[str, PackageInfo] formats for backward compatibility. Migrated managers: apk, apt, brew, cargo, choco, dnf, gem, npm, opkg, pacman, pip, pkg, pkgin, xbps, yum, zypper. Added pkg.update() and pkg.upgrade() operations. Added upgradeable/held sub-facts for each manager that supports them.
Collaborator
Author
Add facts and operations for two new package managers: - Portage: PortagePackages (qlist), PortageUpgradeablePackages (emerge pretend), PortageMaskedPackages (package.mask). Operations: update (emerge --sync), upgrade (idempotent), packages (emerge/depclean). - Paludis: PaludisPackages (cave print-ids). Operations: update (cave sync), upgrade (cave resolve), packages (cave resolve/uninstall). Both support version pinning via category/name=version syntax, translated to =category/name-version atoms for the respective package managers.
|
I was looking for Gentoo/portage support, so this PR is much anticipated. I hope it gets merged soon! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a common
PackageInfodata model (name, version, status) andbuild_package_map()helper so all package managers share a consistent representation of installed, upgradeable, and held packages. Operations likeupgrade()are now idempotent — they check for available upgrades before running. Theensure_packages()function accepts both the olddict[str, set[str]]and newdict[str, PackageInfo]formats for backward compatibility.Changes
PackageInfodataclass andbuild_package_map()infacts.util.packagesto normalize installed/outdated/held package data across all managers.pkgoperations: Addedpkg.update()andpkg.upgrade().portage) and Exherbo (paludis), including facts, operations, and tests.NpmOutdatedPackagesfact to npm directory quoting test.Checklist
3.xat this time)scripts/dev-test.sh)scripts/dev-lint.sh)