-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add local path conversions from lockfile #3609
Conversation
let path_dist = PathSourceDist { | ||
name: self.id.name.clone(), | ||
url: VerbatimUrl::from_url(self.id.source.url.clone()), | ||
path: self.id.source.url.to_file_path().unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit strange that we require both url
and path
, but I think the intent is that we do this fallible conversion when constructing to the type so that we don't have to do it everywhere that we need the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes sense I think.
(I am fond of the idea of encapsulating the distribution types and defining constructors for them. That way, you can add derived fields or whatever else without much fuss. But that's a big refactor and I am not altogether offended by pure data structs. They have their advantages...)
52857cc
to
aa9cca6
Compare
aa9cca6
to
288f51c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Probably after resolver forking is done, I'll plan to take another pass at the lock file format and smooth things out. Hopefully we can limp along as-is for now though.
let path_dist = PathSourceDist { | ||
name: self.id.name.clone(), | ||
url: VerbatimUrl::from_url(self.id.source.url.clone()), | ||
path: self.id.source.url.to_file_path().unwrap(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that makes sense I think.
(I am fond of the idea of encapsulating the distribution types and defining constructors for them. That way, you can add derived fields or whatever else without much fuss. But that's a big refactor and I am not altogether offended by pure data structs. They have their advantages...)
Summary
Just does the most basic thing to convert from
Distribution
back to the installable type.