atom: adapt to portage Atom read-only property rework#63
Merged
gentoo-bot merged 2 commits intoJun 26, 2026
Conversation
portage reworked Atom to expose operator, blocker, use, slot, cp, cpv, and repo as @Property descriptors backed by private _* attributes. The pre-__init__ write "self.operator = self.blocker = self.use = self.slot = None" and the post-__init__ "self.operator = ''" normalization both fail because object.__setattr__() respects data descriptors and raises AttributeError when a property has no setter. Override operator as a read-only property normalizing None to "" to preserve the intersects() contract. Initialize CPV's private attrs directly since portage already manages cpv. Signed-off-by: Matt Turner <mattst88@gentoo.org>
The tuple assignments
ranged, ranged.operator = self, self.operator
evaluate the RHS before binding, so .operator is always written back
with its own value. With operator now a read-only property they raise
AttributeError.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
thesamesam
approved these changes
Jun 26, 2026
thesamesam
left a comment
Member
There was a problem hiding this comment.
I think the fact it has some weird inspiration from pkgcore without just upstreaming it into Portage is weird (i.e. the thing that broke to begin with) but it is what it is.
It may be worth looking to see if we can include any of the niceties from this though.
Anyway, LGTM.
Flowdalic
approved these changes
Jun 26, 2026
Flowdalic
left a comment
Member
There was a problem hiding this comment.
Fixes the issue with portage-9999 for me.
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.
portage reworked Atom to expose operator, blocker, use, slot, cp, cpv, and repo as read-only
@propertydescriptors backed by private _* attributes, breaking Atom instantiation in gentoolkit.Compatible with old portage (pre-rework): old portage stores operator in self.dict directly, which the property getter checks first before falling back to super().