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

Git SHAs are resolved twice when used as direct references #2673

Closed
charliermarsh opened this issue Mar 26, 2024 · 1 comment · Fixed by #2682
Closed

Git SHAs are resolved twice when used as direct references #2673

charliermarsh opened this issue Mar 26, 2024 · 1 comment · Fixed by #2682
Assignees
Labels
bug Something isn't working performance Potential performance improvement

Comments

@charliermarsh
Copy link
Member

E.g., notice that the "Updated" portion appears twice here:

❯ uv pip install git+https://github.com/tiangolo/fastapi
 Updated https://github.com/tiangolo/fastapi (8bfed9a)
 Updated https://github.com/tiangolo/fastapi (8bfed9a)
Resolved 9 packages in 868ms
   Built fastapi @ git+https://github.com/tiangolo/fastapi@8bfed9aee2401a937bc38f336Downloaded 4 packages in 280ms
Installed 7 packages in 3ms
 + annotated-types==0.6.0
 + anyio==4.3.0
 + fastapi==0.110.0 (from git+https://github.com/tiangolo/fastapi@8bfed9aee2401a937bc38f336cddd903722c5286)
 + pydantic==2.6.4
 + pydantic-core==2.16.3
 + starlette==0.36.3
 + typing-extensions==4.10.0
@charliermarsh charliermarsh added the bug Something isn't working label Mar 26, 2024
@charliermarsh
Copy link
Member Author

The behavior is ultimately correct, we should just avoid the second lookup.

@zanieb zanieb added the performance Potential performance improvement label Mar 26, 2024
@charliermarsh charliermarsh self-assigned this Mar 27, 2024
charliermarsh added a commit that referenced this issue Mar 27, 2024
## Summary

Ensures that, even if we try to resolve the same Git reference twice
within an invocation, it always returns a (cached) consistent result.

Closes #2673.

## Test Plan

```
❯ cargo run pip install git+https://github.com/pallets/flask.git --reinstall --no-cache
   Compiling uv-distribution v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-distribution)
   Compiling uv-resolver v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-resolver)
   Compiling uv-installer v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-installer)
   Compiling uv-dispatch v0.0.1 (/Users/crmarsh/workspace/uv/crates/uv-dispatch)
   Compiling uv-requirements v0.1.0 (/Users/crmarsh/workspace/uv/crates/uv-requirements)
   Compiling uv v0.1.24 (/Users/crmarsh/workspace/uv/crates/uv)
    Finished dev [unoptimized + debuginfo] target(s) in 3.95s
     Running `target/debug/uv pip install 'git+https://github.com/pallets/flask.git' --reinstall --no-cache`
 Updated https://github.com/pallets/flask.git (b90a4f1)
Resolved 7 packages in 280ms
   Built flask @ git+https://github.com/pallets/flask.git@b90a4f1f4a370e92054b9cc9db0efcb864f87ebe                                                                                                                                            Downloaded 7 packages in 212ms
Installed 7 packages in 9ms
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working performance Potential performance improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants