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 panics due to missing key in inverse #2358

Closed
david-pl opened this issue Mar 11, 2024 · 2 comments · Fixed by #2360
Closed

Resolver panics due to missing key in inverse #2358

david-pl opened this issue Mar 11, 2024 · 2 comments · Fixed by #2360
Assignees
Labels
bug Something isn't working

Comments

@david-pl
Copy link

I have a requirements.txt with the following contents (somewhat shortened):

alembic==1.13.1
aiohttp==3.9.3
ansible==9.3.0
bcrypt==4.1.2
beautifulsoup4==4.12.3
b2sdk==1.32.0
boto3==1.34.52
celery[redis]==5.2.7
email-validator==2.1.1
Flask==3.0.2
Flask-Caching==2.1.0
flask-debugtoolbar==0.14.1
Flask-Migrate==4.0.5
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
Flask-Mail==0.9.1
google-api-python-client==2.120.0
google-auth==2.28.0
google-auth-httplib2==0.2.0
google-auth-oauthlib==1.2.0
google-cloud-compute==1.17.0
google-cloud-dns==0.35.0
google-cloud-secret-manager==2.18.2
google-cloud-storage==2.14.0
grpcio==1.62.0
gunicorn==21.2.0
hcloud==1.33.2
hubspot-api-client==8.2.1
Jinja2==3.1.3
jira==3.6.0
kombu==5.2.4
ldap3==2.9.1
llama-index==0.4.40
MarkupSafe==2.1.5
oauth2client==4.1.3
oauthlib==3.2.2
octodns==1.5.0
octodns-googlecloud==0.0.3
octodns-route53==0.0.6
openai==0.28.1

Doing

uv venv venv
source venv/bin/activate
uv pip install -r requirements.txt

Errors with

thread 'main' panicked at crates/uv-resolver/src/resolution.rs:230:50:
no entry found for key
@charliermarsh charliermarsh added the bug Something isn't working label Mar 11, 2024
@charliermarsh charliermarsh self-assigned this Mar 11, 2024
@charliermarsh
Copy link
Member

Wow nice, thanks! I'll take these.

charliermarsh added a commit that referenced this issue Mar 11, 2024
## Summary

It turns out that when we iterate over the incompatibilities of a
package, PubGrub will _also_ show us the inverse dependencies. I suspect
this was rare, because we have a version check at the bottom... So, this
specifically required that you had some dependency that didn't end up
appearing in the output resolution, but that matched the version
constraints of the package you care about.

In this case, `langchain-community` depends on `langchain-core`. So we
were seeing an incompatibility like:

```rust
FromDependencyOf(Package(PackageName("langchain-community"), None, None), Range { segments: [(Included("0.0.10"), Included("0.0.10")), (Included("0.0.11"), Included("0.0.11"))] }, Package(PackageName("langchain-core"), None, None), Range { segments: [(Included("0.1.8"), Excluded("0.2"))] })
```

Where we were iterating over `langchain-core`, and looking for version
`0.0.11`... which happens to match `langchain-community`.
(`langchain-community was omitted from the resolution; hence, it didn't
exist in the map.)

Closes #2358.
@david-pl
Copy link
Author

Wow, that was quick! Awesome, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants