sdispater / mixology

A generic dependency-resolution library written in pure Python
MIT License
79 stars 11 forks source link

Need help when port the PubGrub version solver into other language #8

Closed hainesc closed 3 years ago

hainesc commented 4 years ago

Hi, @sdispater, thanks for your great work here!

I was confused when I read a piece of your code, see https://github.com/sdispater/mixology/blob/master/mixology/incompatibility.py#L29 there you remove the root package from generated incompatibilities, since it will always be satisfied, but,

term.is_positive() and term.package != Package.root()

is there a typo here? I think it should be:

term.is_positive() and term.package == Package.root()

I do a double check by reading ruby port of the PubGrub version solver, see https://github.com/jhawthorn/pub_grub/blob/master/lib/pub_grub/incompatibility.rb#L121

Would you mind to make a check and explain? Thanks!