mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-14 12:29:11 +00:00
[ty] Resolve python environment in Options::to_program_settings
(#18960)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
d00697621e
commit
1dcdf7f41d
11 changed files with 208 additions and 277 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue