-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg: Support upstream metadata #5
base: master
Are you sure you want to change the base?
Conversation
97f1ba9
to
938e5d2
Compare
Some tests make sense only for Portage, how to handle this? |
When a feature is missing from the PM, raise |
Good idea, now |
gentoopm/basepm/pkg.py
Outdated
def upstream(self) -> typing.Optional[PMUpstream]: | ||
""" | ||
Get the package upstream metadata (or ``None`` if unavailable). | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if the distinction for None
is really useful here. After all, none of the "upstream" keys are mandatory, so there's no technical difference between "missing" upstream metadata and "empty" upstream metadata, so it feels like asking consumers to separately detect two equivalent cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reduced the number of keys with such distinction
gentoopm/portagepm/pkg.py
Outdated
return tuple(PortagePackageMaintainer(m) for m in meta.maintainers()) | ||
|
||
@property | ||
def upstream(self) -> typing.Optional[PMUpstream]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, this isn't really consistent with gentoopm design. The idea was to provide thin wrappers over PM data types, not copy everything over. So in this case you'd return a PortageUpstream
object that would provide accessors for all the shit.
Or well, technically, you wouldn't make a special "upstream" subclass about it and just put them as top-level properties of package class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I get it right this time?
Fully supported only for Portage, pkgcore can return only remote-ids.
Fully supported only for Portage, pkgcore can return only remote-ids.