[ty] Resolve python environment in Options::to_program_settings (#18960)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Micha Reiser 2025-06-26 17:57:16 +02:00 committed by GitHub
parent d00697621e
commit 1dcdf7f41d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 208 additions and 277 deletions

View file

@ -7,10 +7,7 @@ use ruff_python_ast::PythonVersion;
use crate::db::tests::TestDb;
use crate::program::{Program, SearchPathSettings};
use crate::{
ProgramSettings, PythonEnvironmentPath, PythonPlatform, PythonVersionSource,
PythonVersionWithSource,
};
use crate::{ProgramSettings, PythonPlatform, PythonVersionSource, PythonVersionWithSource};
/// A test case for the module resolver.
///
@ -246,7 +243,7 @@ impl TestCaseBuilder<MockedTypeshed> {
python_platform,
search_paths: SearchPathSettings {
custom_typeshed: Some(typeshed.clone()),
python_environment: PythonEnvironmentPath::Testing(vec![site_packages.clone()]),
site_packages_paths: vec![site_packages.clone()],
..SearchPathSettings::new(vec![src.clone()])
}
.to_search_paths(db.system(), db.vendored())
@ -306,7 +303,7 @@ impl TestCaseBuilder<VendoredTypeshed> {
},
python_platform,
search_paths: SearchPathSettings {
python_environment: PythonEnvironmentPath::Testing(vec![site_packages.clone()]),
site_packages_paths: vec![site_packages.clone()],
..SearchPathSettings::new(vec![src.clone()])
}
.to_search_paths(db.system(), db.vendored())