Skip to content
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
22 changes: 11 additions & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resolver = "2"

[workspace.package]
edition = "2021"
version = "0.3.44"
version = "0.3.45"
description = "Tower is the best way to host Python data apps in production"
rust-version = "1.81"
authors = ["Brad Heller <brad@tower.dev>"]
Expand Down
36 changes: 35 additions & 1 deletion crates/tower-uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub fn cleanup_stale_uv_lock_files() {

// Only process files matching the uv-*.lock pattern
if let Some(file_name) = path.file_name() {
if is_uv_lock_file_name(&file_name) {
if !is_uv_lock_file_name(&file_name) {
continue;
}
} else {
Expand Down Expand Up @@ -541,4 +541,38 @@ mod tests {
drop(file);
let _ = fs::remove_file(&lock_path);
}

#[test]
fn test_cleanup_stale_uv_lock_files_only_removes_uv_lock_files() {
let temp_dir = std::env::temp_dir();

// Create a valid UV lock file (matches uv-<16 hex chars>.lock pattern)
let uv_lock_file = temp_dir.join("uv-0123456789abcdef.lock");
{
let mut file = fs::File::create(&uv_lock_file).unwrap();
file.write_all(b"test uv lock").unwrap();
}

// Create a non-UV file that should NOT be touched
let non_uv_file = temp_dir.join("not-a-uv-lock-file.txt");
{
let mut file = fs::File::create(&non_uv_file).unwrap();
file.write_all(b"other file").unwrap();
}

assert!(uv_lock_file.exists());
assert!(non_uv_file.exists());

// Run the cleanup
cleanup_stale_uv_lock_files();

// UV lock file should be removed (it wasn't locked)
assert!(!uv_lock_file.exists(), "UV lock file should have been cleaned up");

// Non-UV file should still exist
assert!(non_uv_file.exists(), "Non-UV file should not have been touched");

// Clean up the non-UV file
let _ = fs::remove_file(&non_uv_file);
}
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "tower"
version = "0.3.44"
version = "0.3.45"
description = "Tower CLI and runtime environment for Tower."
authors = [{ name = "Tower Computing Inc.", email = "brad@tower.dev" }]
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.