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

[resolver] Use resolvelib for the dependency resolution #93

Open
webknjaz opened this issue Dec 14, 2023 · 3 comments
Open

[resolver] Use resolvelib for the dependency resolution #93

webknjaz opened this issue Dec 14, 2023 · 3 comments

Comments

@webknjaz
Copy link

I'm raising this because the issue search hasn't brought up any related discussions. I noticed that micropip uses a very simple homegrown resolution process and would probably be less stable than the widely used one.
Pip's current backtracking resolver is a pluggable and agnostic. It can be brought into other projects easily (I integrated it into ansible-galaxy, for example). It's called resolvelib and it can be a dependency (or vendored).
The project is here: https://github.com/sarugaku/resolvelib.

@rth
Copy link
Member

rth commented Dec 14, 2023

Hi @webknjaz ,

Thanks for the suggestion. Absolutely resolvelib is certainly much better that the simple solver we have in this repo (and we use it for instance in pyodide/pyodide#3310).

However, given that this runs on a webpage it's not clear that a backtracking solver even makes sense both in terms of resolution time and backtracking (particularly in the case where you need to download the wheel to know its dependencies before the more recent PEPs on this were implemented). So the idea so far was now use simple dependency resolution in micropip (which is fast). If you need more advanced setup, generate a lockfile (either micropip.freeze() or pyodide/pyodide-lock#10 not yet implemented) and load it from there.

@webknjaz
Copy link
Author

Sure, it certainly makes sense to have this for the constraint files. By the way, I posted some thoughts on the misconceptions recently, related to the lockfiles: jazzband/pip-tools#1326 (comment)

@hoodmane
Copy link
Member

In any case we really ought to have a way to do deterministic resolutions.

I think one reasonable workflow for now is to create a Pyodide virtual environment and then install with pip and generate a lock file from the virtual environment. This only works for static dependency sets.

But particularly we need to have a convenient way to do an expensive stable resolution to generate a lock file for an application.

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

No branches or pull requests

3 participants