Repository navigation
Save Sdist to disk and use PKG-INFO metadata - #71
Conversation
|
Nice! Just a little issue with the conflict. |
| // 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.
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.
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.
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.
Maybe we should talk about packages instead? Not sure the average person understands what we mean with an artifact.
| 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.
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!