You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix version json tests to work outside git checkout (astral-sh#13566)
## Summary
Fix the two version json tests to account for the possibility that uv
was built outside a git checkout (e.g. from an unpacked git archive) and
therefore does not have the commit info available. This approach uses
separate snapshots for the two cases, as suggested in discussion of pull
request astral-sh#13251.
Fixesastral-sh#13212
## Test Plan
1. `cargo test` in a git clone.
2. `cargo clean`, moved `.git` away, `cargo test` again.
---------
Co-authored-by: Aria Desires <[email protected]>
warning: Failed to read project metadata (The project is marked as unmanaged: `[TEMP_DIR]/`). Running `uv self version` for compatibility. This fallback will be removed in the future; pass `--preview` to force an error.
992
-
"#);
1007
+
----- stderr -----
1008
+
warning: Failed to read project metadata (The project is marked as unmanaged: `[TEMP_DIR]/`). Running `uv self version` for compatibility. This fallback will be removed in the future; pass `--preview` to force an error.
1009
+
"#);
1010
+
}else{
1011
+
uv_snapshot!(filters, context.version()
1012
+
.arg("--output-format").arg("json"), @r#"
1013
+
success: true
1014
+
exit_code: 0
1015
+
----- stdout -----
1016
+
{
1017
+
"package_name": "uv",
1018
+
"version": "[VERSION]",
1019
+
"commit_info": null
1020
+
}
1021
+
1022
+
----- stderr -----
1023
+
warning: Failed to read project metadata (The project is marked as unmanaged: `[TEMP_DIR]/`). Running `uv self version` for compatibility. This fallback will be removed in the future; pass `--preview` to force an error.
1024
+
"#);
1025
+
}
993
1026
994
1027
let pyproject = fs_err::read_to_string(&pyproject_toml)?;
0 commit comments