-
Notifications
You must be signed in to change notification settings - Fork 920
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 Directory
its own distribution kind
#3519
Conversation
@@ -71,6 +72,7 @@ impl<'a> SourceUrl<'a> { | |||
Self::Direct(dist) => dist.url, | |||
Self::Git(dist) => dist.url, | |||
Self::Path(dist) => dist.url, | |||
Self::Directory(dist) => dist.url, |
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.
I kind of wish the names were like... Directory
and Archive
? But Archive
is a bit strange.
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.
I like Archive
, pip uses that terminology too
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.
Is Archive
in this context referring to a specific file like a .tar.gz
? If that's always the case, then I like the name Archive
.
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 it needs to be a .tar.gz
or .zip
or .tar.bz2
or a few other extensions that we support.
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.
I don't know that it's a perfect name because (e.g.) when you provide Direct
(i.e., a direct URL), that has to be a direct URL to... an archive. So they're both archives?
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.
Honestly Self::File
could be the right name.
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's a good point. I suppose PathArchive
would also work and is maybe a bit more descriptive. But I agree that File
also works. And it's more succinct.
BuildableSource::Dist(SourceDist::Path(dist)) => { | ||
if dist.path.is_dir() { |
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.
This is good IMO, we removed this branch in favor of types that encode the difference.
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. I like.
Need to fix test failures. |
f20d3b5
to
1f1e274
Compare
f418142
to
c940843
Compare
c940843
to
b61b014
Compare
Ok, tests passing... |
.as_ref() | ||
.join("pyproject.toml") | ||
.metadata() | ||
.ok() |
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.
Should we raise those if they aren't file not found errors?
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.
Yes, I'll do it separately though since this is just a move from above.
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.
This LGTM. Contrary to what I said in the DM, in context, I think Archive
is a good name if it always refers to a single archive-like file (i.e., .tar.gz
).
@@ -71,6 +72,7 @@ impl<'a> SourceUrl<'a> { | |||
Self::Direct(dist) => dist.url, | |||
Self::Git(dist) => dist.url, | |||
Self::Path(dist) => dist.url, | |||
Self::Directory(dist) => dist.url, |
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.
Is Archive
in this context referring to a specific file like a .tar.gz
? If that's always the case, then I like the name Archive
.
BuildableSource::Dist(SourceDist::Path(dist)) => { | ||
if dist.path.is_dir() { |
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. I like.
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.