Skip to content

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

Open
ddelange wants to merge 4 commits intosdispater:masterfrom
ddelange:feature/choice
Open

After least versions, the package with least dependencies is chosen#5
ddelange wants to merge 4 commits intosdispater:masterfrom
ddelange:feature/choice

Conversation

@ddelange
Copy link
Copy Markdown

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

Comment thread mixology/version_solver.py Outdated
@ddelange
Copy link
Copy Markdown
Author

ddelange commented Mar 26, 2022

Hi @sdispater 👋

Was going though old pulls and wanted to ask if I shall close the ones here and python-poetry/semver#4? Are mixology and semver more or less public archive (ref #5 (comment))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant