Skip to content
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

fix: issue with zip and artifact:from_file #221

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
tdejager marked this conversation as resolved.
Show resolved Hide resolved

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());
}
}
Loading