-
Notifications
You must be signed in to change notification settings - Fork 23
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
Save Sdist to disk and use PKG-INFO metadata #71
Conversation
Nice! Just a little issue with the conflict. |
@@ -107,7 +107,7 @@ pub async fn index(index_url: Url) -> Result<(), miette::Error> { | |||
|
|||
// Continue if there was an error in downloading and skip for now :) | |||
let metadata = if let Some(metadata) = metadata { | |||
metadata.1 | |||
metadata.unwrap().1 |
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.
tbh reading this is a bit confusing :D Is there a way to make this a bit more clear?
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.
And maybe if this is a safe unwrap, you could add a little comment? I think Bas would ask for an expect either way :D
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 so I'm a bit unsure about this index program file as it's kinda half-baked, would rather pull it out of this project entirely and make it kinda nice. Do you still want met to change it?
if artifacts.is_empty() { | ||
// If there are no wheel artifacts, we're just gonna skip it | ||
return Err("there are no wheels available"); | ||
return Err("there are no artifacts available"); |
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.
Maybe we should talk about packages
instead? Not sure the average person understands what we mean with an artifact.
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.
Sure!
let mut bytes = Vec::new(); | ||
entry.read_to_end(&mut bytes).into_diagnostic()?; | ||
let metadata = Self::parse_metadata(&bytes)?; | ||
return Ok((bytes, metadata)); |
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 should only use this metadata from the PKG-INFO file if the metadata version is 2.2 or greater. Using on older versions means that you'd rely on the metadata not required to be reliable.
Making some progress on: #32
Should now save sdists when running the resolution step.
E.g
This uses the PKG-INFO metadata https://peps.python.org/pep-0643/ to resolve the metadata for the source distribution. Any PEP517 conformant build back-end should make this. So these are a lot.
The
cargo r apache-airflow[all]
seems to use the sdist resolution as well, although it fails on a package that does not meet my python interpreter requirement, will look into this later if this is the case.Next up, sdist building, stay tuned!