Skip to content

Commit

Permalink
fix: issue with zip and artifact:from_file (#221)
Browse files Browse the repository at this point in the history
These PR address 2 major issues and 1 small issue
* zip file stamps issue
alexcrichton/tar-rs#349 which we encountered
when installing tomli-2.1.0
* changed from_filename signature so it can also produce Stree, which
it's needed from pixi side
* lowercase Root-Is-Purelib so we can install elsie library (
prefix-dev/pixi#771 (comment))
  • Loading branch information
nichmor committed Feb 15, 2024
1 parent 6e919da commit 49cc1e1
Show file tree
Hide file tree
Showing 7 changed files with 9,010 additions and 6 deletions.
40 changes: 40 additions & 0 deletions crates/rattler_installs_packages/src/artifacts/sdist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1293,4 +1293,44 @@ mod tests {

assert_debug_snapshot!(direct_url_json);
}

#[tokio::test(flavor = "multi_thread")]
pub async fn test_zip_timestamps_before_1980_error() {
let url = Url::parse("https://files.pythonhosted.org/packages/c0/3f/d7af728f075fb08564c5949a9c95e44352e23dee646869fa104a3b2060a3/tomli-2.0.1.tar.gz").unwrap();

let package_db = get_package_db();
let env_markers = Arc::new(Pep508EnvMakers::from_env().await.unwrap().0);
let wheel_builder = WheelBuilder::new(
package_db.0.clone(),
env_markers,
None,
ResolveOptions::default(),
HashMap::default(),
)
.unwrap();

let norm_name = PackageName::from_str("tomli").unwrap();
let sdist_remote_filename = SDistFilename {
distribution: norm_name,
version: Version::from_str("0.0.0").unwrap(),
format: SDistFormat::TarGz,
};
let artifact_info = ArtifactInfo {
filename: ArtifactName::SDist(sdist_remote_filename),
url: url.clone(),
is_direct_url: true,
hashes: None,
requires_python: None,
dist_info_metadata: DistInfoMetadata::default(),
yanked: Yanked::default(),
};

let (wheel, _) = package_db
.0
.get_wheel(&artifact_info, Some(&wheel_builder))
.await
.unwrap();

assert_debug_snapshot!(wheel.metadata());
}
}

0 comments on commit 49cc1e1

Please sign in to comment.