[ty] Track the origin of the environment.python setting for better error messages (#18483)

This commit is contained in:
Alex Waygood
2025-06-06 13:36:41 +01:00
committed by GitHub
parent 8d24760643
commit 1274521f9f
9 changed files with 313 additions and 75 deletions

View File

@@ -235,7 +235,7 @@ impl SearchPaths {
let (site_packages_paths, python_version) = match python_path {
PythonPath::IntoSysPrefix(path, origin) => {
if *origin == SysPrefixPathOrigin::LocalVenv {
if origin == &SysPrefixPathOrigin::LocalVenv {
tracing::debug!("Discovering virtual environment in `{path}`");
let virtual_env_directory = path.join(".venv");
@@ -260,7 +260,7 @@ impl SearchPaths {
})
} else {
tracing::debug!("Resolving {origin}: {path}");
PythonEnvironment::new(path, *origin, system)?.into_settings(system)?
PythonEnvironment::new(path, origin.clone(), system)?.into_settings(system)?
}
}