sdispater / mixology

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

After least versions, the package with least dependencies is chosen #5

Open ddelange opened 4 years ago

ddelange commented 4 years ago

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).

ddelange commented 2 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)?