Open ddelange opened 4 years ago
Hi @sdispater 👋
Was going though old pulls and wanted to ask if I shall close the ones here and https://github.com/python-poetry/semver/pull/4? Are mixology
and semver
more or less public archive (ref https://github.com/sdispater/mixology/pull/5#issuecomment-1079659588)?
This PR makes sure that first the package with least satisfying versions is chosen. If there are multiple packages with e.g. only one satisfying version, a second metric will decide the winner: the amount of dependencies of the highest satisfying version.
This way (if e.g. there are many dependencies with an exact pin), less dependencies need to be inspected before the next decision, improving solving time for big nested packages.
In my case, I'm using a PackageSource object that will on demand resolve the dependencies and available versions for a package by inspecting wheels from PyPI repositories. This adds overhead to the algorithm, but allows to start
solve()
with an empty (undiscovered) tree and one or more root dependencies. Getting wheels for packages with many dependencies takes a lot of time (and might be completely unnecessary if we inspect only few dependencies for a different term).