Add debug logs for version file search (#12951)

Co-authored-by: John Mumm <jtfmumm@gmail.com>
This commit is contained in:
Zanie Blue 2025-04-18 11:31:52 -05:00 committed by GitHub
parent 91410acf82
commit 41ac6649d7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 1 deletions

View file

@ -69,7 +69,26 @@ impl PythonVersionFile {
working_directory: impl AsRef<Path>,
options: &DiscoveryOptions<'_>,
) -> Result<Option<Self>, std::io::Error> {
let Some(path) = Self::find_nearest(working_directory, options) else {
let Some(path) = Self::find_nearest(&working_directory, options) else {
if let Some(stop_discovery_at) = options.stop_discovery_at {
if stop_discovery_at == working_directory.as_ref() {
debug!(
"No Python version file found in workspace: {}",
working_directory.as_ref().display()
);
} else {
debug!(
"No Python version file found between working directory `{}` and workspace root `{}`",
working_directory.as_ref().display(),
stop_discovery_at.display()
);
}
} else {
debug!(
"No Python version file found in ancestors of working directory: {}",
working_directory.as_ref().display()
);
}
// Not found in directory or its ancestors. Looking in user-level config.
return Ok(match user_uv_config_dir() {
Some(user_dir) => Self::discover_user_config(user_dir, options)