Skip to content

Commit

Permalink
Only report Python pins as updated if its the same file (#8894)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Nov 7, 2024
1 parent 0894868 commit 75e4ab0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/uv/src/commands/python/pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/it/python_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----
"###);
Expand Down

0 comments on commit 75e4ab0

Please sign in to comment.