Skip to content

Commit 665ae5f

Browse files
committed
Publish: Ignore non-matching files
Fixes #8944
1 parent 489d42a commit 665ae5f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

crates/uv-publish/src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,10 @@ pub fn files_for_publishing(
251251
else {
252252
continue;
253253
};
254-
if filename == ".gitignore" {
254+
let Some(dist_filename) = DistFilename::try_from_normalized_filename(&filename) else {
255+
debug!("Not a distribution filename: `{filename}`");
255256
continue;
256-
}
257-
let dist_filename = DistFilename::try_from_normalized_filename(&filename)
258-
.ok_or_else(|| PublishError::InvalidFilename(dist.clone()))?;
257+
};
259258
files.push((dist, filename, dist_filename));
260259
}
261260
}

scripts/publish/test_publish.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def build_project_at_version(
219219

220220
# Build the project
221221
check_call([uv, "build"], cwd=project_root)
222+
# Test that we ignore unknown any file.
223+
project_root.joinpath("dist").joinpath(".DS_Store").touch()
222224

223225
return project_root
224226

0 commit comments

Comments
 (0)