Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ddelange
Copy link

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

mixology/version_solver.py Outdated Show resolved Hide resolved
@ddelange
Copy link
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