Bug 1022940 - _bestPackageFromList doesn't work
Summary: _bestPackageFromList doesn't work
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 979353
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-24 10:06 UTC by Daniel Mach
Modified: 2013-10-24 11:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-10-24 11:16:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Daniel Mach 2013-10-24 10:06:28 UTC
Version:
dnf-0.4.5-1.fc21.noarch

Problem:
AttributeError: 'Base' object has no attribute '_compare_providers'

Reproducer:
import dnf.base
base = dnf.base.Base()
print base._bestPackageFromList([1, 2])


It's related to bug#979353 - we need this functionality, preferably in hawkey, but dnf would be also acceptable.

Comment 1 Zdeněk Pavlas 2013-10-24 10:28:51 UTC
I'm afraid this is going to be CANTFIX'd.  libsolv internally considers "all" providers, and this is burried very deep.  This functionality is not needed.

All you can do is searching for all packages providing "foo", and excluding all but the one you want to use.  But this has to run *before* depsolving, not in a callback.

Comment 2 Ales Kozumplik 2013-10-24 11:16:57 UTC
Hi Dan,

It has been explained many times now that the DNF API is not to be used until documentation to it is published. Therefore nothing is supported yet and it is possible things like _bestPackageFromLIst will be dropped entirely. I am afraid we can not help you here, for the reasons mentioned by Zdenek in comment 1. Also, as you mention we are already tracking this in bug 979353.

> print base._bestPackageFromList([1, 2])

And we certainly will not document and support methods starting with an underscore in the API, please see PEP 0008 [1]

[1] http://www.python.org/dev/peps/pep-0008/


Note You need to log in before you can comment on or make changes to this bug.