mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-15 12:59:38 +00:00
[ty] Move venv and conda env discovery to SearchPath::from_settings
(#18938)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
d04e63a6d9
commit
76387295a5
14 changed files with 147 additions and 108 deletions
|
@ -8,7 +8,8 @@ use ruff_python_ast::PythonVersion;
|
|||
use crate::db::tests::TestDb;
|
||||
use crate::program::{Program, SearchPathSettings};
|
||||
use crate::{
|
||||
ProgramSettings, PythonPath, PythonPlatform, PythonVersionSource, PythonVersionWithSource,
|
||||
ProgramSettings, PythonEnvironmentPath, PythonPlatform, PythonVersionSource,
|
||||
PythonVersionWithSource,
|
||||
};
|
||||
|
||||
/// A test case for the module resolver.
|
||||
|
@ -245,7 +246,7 @@ impl TestCaseBuilder<MockedTypeshed> {
|
|||
python_platform,
|
||||
search_paths: SearchPathSettings {
|
||||
custom_typeshed: Some(typeshed.clone()),
|
||||
python_path: PythonPath::KnownSitePackages(vec![site_packages.clone()]),
|
||||
python_environment: PythonEnvironmentPath::Testing(vec![site_packages.clone()]),
|
||||
..SearchPathSettings::new(vec![src.clone()])
|
||||
}
|
||||
.to_search_paths(db.system(), db.vendored())
|
||||
|
@ -305,7 +306,7 @@ impl TestCaseBuilder<VendoredTypeshed> {
|
|||
},
|
||||
python_platform,
|
||||
search_paths: SearchPathSettings {
|
||||
python_path: PythonPath::KnownSitePackages(vec![site_packages.clone()]),
|
||||
python_environment: PythonEnvironmentPath::Testing(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