-
Notifications
You must be signed in to change notification settings - Fork 22
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
Make urllib
and botocore
conflict resolve faster
#191
Comments
This is an intuitive optimization that makes sense in the real Python ecosystem, but you have to be a bit careful as it's definitely not true in general. Let's say the candidate But I would highlight two situations where it might trip up that are likely to be encountered in real world situations with real motivation:
All that said, this general idea has been on my mind for Pip resolution for a while now. But I was unsure how to efficently implement it. I am working on a new API between resolvelib and Pip to make it possible to efficently compare multiple candidates at the same time, and this post made me realize this is probably going to be a good optimization using the new API. |
rip and uv have very similiar performance resolution characteristics, and in this case pip suffers from the same issues. As such I actually put some work in to this today. I already repeated this on the uv issue, I created a very hacky experimental proof of concept branch on pip side that implements the idea of preferring upper bounded requirements: pypa/pip@main...notatallshaw:pip:backjump-to-upper-bounded For the set of requirements To get this to work for resolvelib I had to add a completely new API, which substantially changes the path of the algorithm, and it would need to be carefully checked it can still soundly resolve any given requirement, so I don't expect I'll ever be able to contribute this to either the resolvelib or pip project. Also, I did have to hack resolvelib into understanding a bit about extras, as part of the core issue here is both the requirement on Hope this info helps. |
When resolving
botocore
andurllib
it can happen thatrip
chooses the highest version ofurllib3
(2.2) and then tries to resolvebotocore
.However,
botocore
has an upper bound forurllib >=1.5,<2.1
or something like that.Now the logical thing to do would be to lock in
botocore
and try older (compatible) versions ofurllib3
. Instead,rip
tries all versions ofbotocore
in existence (which are many) until it hits an outdated, broken sdist and crashes :'(I think we should have some logic that implicitly adds the upper bound of any higher version to the lower versions and therefore dismisses
urllib3 2.2
for any version of botocore (because it doesn't really make sense that a previous version ofbotocore
would be compatible with a laterurllib3
).The text was updated successfully, but these errors were encountered: