[ty] Tell the user why we inferred the Python version we inferred (#18082)

This commit is contained in:
Alex Waygood 2025-05-21 11:06:27 -04:00 committed by GitHub
parent cb9e66927e
commit d37592175f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 303 additions and 124 deletions

View file

@ -9,8 +9,8 @@ use ruff_db::{Db as SourceDb, Upcast};
use ruff_python_ast::PythonVersion;
use ty_python_semantic::lint::{LintRegistry, RuleSelection};
use ty_python_semantic::{
Db, Program, ProgramSettings, PythonPath, PythonPlatform, SearchPathSettings,
default_lint_registry,
Db, Program, ProgramSettings, PythonPath, PythonPlatform, PythonVersionSource,
PythonVersionWithSource, SearchPathSettings, default_lint_registry,
};
static EMPTY_VENDORED: std::sync::LazyLock<VendoredFileSystem> = std::sync::LazyLock::new(|| {
@ -44,7 +44,10 @@ impl ModuleDb {
Program::from_settings(
&db,
ProgramSettings {
python_version,
python_version: PythonVersionWithSource {
version: python_version,
source: PythonVersionSource::default(),
},
python_platform: PythonPlatform::default(),
search_paths,
},