-
Notifications
You must be signed in to change notification settings - Fork 734
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
iron out how to represent path dependencies in the universal lock file #3506
Comments
I can look at the first bullet there, splitting |
## Summary I think this is overall good change because it explicitly encodes (in the type system) something that was previously implicit. I'm not a huge fan of the names here, open to input. It covers some of #3506 but I don't think it _closes_ it.
What does the second bullet mean exactly? Can you flesh it out a bit more? Perhaps I can help with it. |
Is it that the path gets omitted entirely when it's part of the workspace? |
Yeah exactly. Cargo rebuilds the path from the (There is at least one other interaction point as well: finding the relevant root package in the lock file at which to start a graph traversal.) |
Fixed by #4205, we can revisit this later if we want to omit paths |
We want to support path dependencies in our lock file. But the data model for path dependencies in our lock file is, at the time of writing, not quite right. I believe what we ought to have for a path dependency is a single file URL to a directory, source distribution or wheel. But the data model currently allows for a source distribution and zero or more wheels, but specifically does not allow for a directory.
I think the current data model is mostly just a reaction to the types that we have after resolution. Namely, I think we have two related types. The first is for wheel path dependencies:
uv/crates/distribution-types/src/lib.rs
Lines 174 to 180 in 616ed53
And the second is for source distribution path dependencies:
uv/crates/distribution-types/src/lib.rs
Lines 206 to 213 in 616ed53
My understanding is that the second is also used when we have a path dependency to a directory.
This all matters for the lock file because if a path dependency points to a wheel or a source dist, then we want to record a hash for it. But if it comes from a directory, then we very specifically do not want to record a hash.
So to fix this issue, I think we need to:
PathSourceDist
type so that it indicates whether it came from a real source distribution or a directory. Possibly one way to do this is to split the type in two, with one type representing source distributions and the other representing a directory.Lock
data model so that distributions with apath
source kind are more limited than what they are today. I think we actually do not want to encode the file path itself, and instead derive that from thepyproject.toml
. (This would match what Cargo does.)The text was updated successfully, but these errors were encountered: