This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1022940 - _bestPackageFromList doesn't work
_bestPackageFromList doesn't work
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On: 979353
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-24 06:06 EDT by Daniel Mach
Modified: 2013-10-24 07:16 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-10-24 07:16:57 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Daniel Mach 2013-10-24 06:06:28 EDT
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 06:28:51 EDT
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 07:16:57 EDT
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.