Bug 1016708

Summary: python-solv api broke between 0.0.0-17 in F18 and 0.3.0 in F19
Product: [Fedora] Fedora Reporter: John Dulaney <jdulaney>
Component: libsolvAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: akozumpl, bwalker, mls, packaging-team-maint, pnemade
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-08 16:53:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description John Dulaney 2013-10-08 14:48:14 UTC
Description of problem:
I am working on a dependency checker for taskbot, the replacement for AutoQA.  When libsolv's version changed, python-solv broke.

Version-Release number of selected component (if applicable):
0.3.0

How reproducible:
Always


Actual results:

Traceback (most recent call last):
  File "./depcheck.py", line 158, in <module>
    parse_repos(args.rpm, args.arch, 'fedora')
  File "./depcheck.py", line 116, in parse_repos
    jobs.append(armv7hl.Job(solv.Job.SOLVER_INSTALL|solv.Job.SOLVER_SOLVABLE, solvable))
  File "/usr/lib64/python2.7/site-packages/solv.py", line 748, in Job
    def Job(self, *args): return _solv.Pool_Job(self, *args)
TypeError: in method 'Pool_Job', argument 3 of type 'Id'

Expected results:

Dependency solving goodness

Comment 1 Ales Kozumplik 2013-10-08 16:53:45 UTC
Hi John, thank you for the report. I don't see we package 'depcheck.py' in python-solv, please reopen this if we do. The libsolv upstream does not guarantee API compatibility between patchlevels and even less so between minor versions. I'm afraid there is not much I can do here, except to hope that the API will be more stable from now on (and from what I see in the libsolv upstream I have a reason to believe that).

Comment 2 John Dulaney 2013-10-08 17:35:19 UTC
depcheck is the project I'm working on; it would be kind of cool if at least the docs would be fixed to reflect the changes.

Comment 3 John Dulaney 2013-10-08 20:48:44 UTC
(In reply to Ales Kozumplik from comment #1)
> Hi John, thank you for the report. I don't see we package 'depcheck.py' in
> python-solv, please reopen this if we do. The libsolv upstream does not
> guarantee API compatibility between patchlevels and even less so between
> minor versions. I'm afraid there is not much I can do here, except to hope
> that the API will be more stable from now on (and from what I see in the
> libsolv upstream I have a reason to believe that).


Do you reckon you could give me some docs on the new API?  What I'm looking at is no different than what I used for the old API.

Comment 4 Ales Kozumplik 2013-10-09 05:53:13 UTC
there's some documentation in the upstream checkout[1], and libsolv-devel[2] packcages the man files.

[1] https://github.com/openSUSE/libsolv/tree/master/doc
[2] http://koji.fedoraproject.org/koji/rpminfo?rpmID=4399657

Comment 5 Michael Schröder 2013-10-10 09:25:34 UTC
I try very hard to keep the API stable.

In your case, the Job() constructor API has not changed, but I changed the add_rpm() method to return a solvable object instead of a solvable id. Returning the object makes much more sense and is consistent with the add_solvable() method.

So you can probably fix your code by changing the code to:

jobs.append(armv7hl.Job(solv.Job.SOLVER_INSTALL|solv.Job.SOLVER_SOLVABLE, solvable.id))

i.e. solvable.id instead of solvable.