sarugaku / resolvelib

Resolve abstract dependencies into concrete ones
ISC License
138 stars 31 forks source link

Better reporter demo #51

Closed pradyunsg closed 4 years ago

pradyunsg commented 4 years ago

The output of running reporter_demo now looks like:

  adding_requirement(Requirement(first), None)
starting()
starting_round(0)
  adding_requirement(Requirement(second==3.0.0), Candidate(first, 3.0.0))
  adding_requirement(Requirement(third==2.0.0), Candidate(first, 3.0.0))
  pinning(Candidate(first, 3.0.0))
ending_round(0, ...)
starting_round(1)
  adding_requirement(Requirement(third==3.0.0), Candidate(second, 3.0.0))
  backtracking(Candidate(first, 3.0.0))
ending_round(1, ...)
starting_round(2)
  adding_requirement(Requirement(second==2.0.0), Candidate(first, 2.0.0))
  adding_requirement(Requirement(third==1.0.0), Candidate(first, 2.0.0))
  pinning(Candidate(first, 2.0.0))
ending_round(2, ...)
starting_round(3)
  adding_requirement(Requirement(third==2.0.0), Candidate(second, 2.0.0))
  backtracking(Candidate(first, 2.0.0))
ending_round(3, ...)
starting_round(4)
  adding_requirement(Requirement(second==1.0.0), Candidate(first, 1.0.0))
  pinning(Candidate(first, 1.0.0))
ending_round(4, ...)
starting_round(5)
  adding_requirement(Requirement(third==1.0.0), Candidate(second, 1.0.0))
  pinning(Candidate(second, 1.0.0))
ending_round(5, ...)
starting_round(6)
  pinning(Candidate(third, 1.0.0))
ending_round(6, ...)
starting_round(7)
ending(...)
{'first': Candidate(first, 1.0.0),
 'second': Candidate(second, 1.0.0),
 'third': Candidate(third, 1.0.0)}

I think this is a nice bit of improvement to the example.

pradyunsg commented 4 years ago

@uranusjr Notice the ending of the reporter calls here (starting_round(7) then ending(...)) -- that feels a bit weird to me, and it might be worth looking into later.

uranusjr commented 4 years ago

That’s expected, the last round checks whether there’s anything else to do, and exits when there’s none. ending_round() is not called on the last round if resolution succeeds.


Delaying this until #49 lands since there’ll be conflicts.

uranusjr commented 4 years ago

Conflicts resolved locally.