From c134ac2eab2bb732156b7b8f2df2135f9e9e2d5f Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 7 Nov 2024 13:24:38 -0600 Subject: [PATCH] Only report Python pins as updated if its the same file (#8894) --- crates/uv/src/commands/python/pin.rs | 2 ++ crates/uv/tests/it/python_find.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/uv/src/commands/python/pin.rs b/crates/uv/src/commands/python/pin.rs index da43dd56c..4f0f3d135 100644 --- a/crates/uv/src/commands/python/pin.rs +++ b/crates/uv/src/commands/python/pin.rs @@ -132,8 +132,10 @@ pub(crate) async fn pin( new.write().await?; + // If we updated an existing version file to a new version if let Some(existing) = existing .as_ref() + .filter(|existing| existing.path() == new.path()) .and_then(PythonVersionFile::version) .filter(|version| *version != new.version().unwrap()) { diff --git a/crates/uv/tests/it/python_find.rs b/crates/uv/tests/it/python_find.rs index 2f0691f7c..afa14fb17 100644 --- a/crates/uv/tests/it/python_find.rs +++ b/crates/uv/tests/it/python_find.rs @@ -213,7 +213,7 @@ fn python_find_pin() { success: true exit_code: 0 ----- stdout ----- - Updated `.python-version` from `3.12` -> `3.11` + Pinned `.python-version` to `3.11` ----- stderr ----- "###);