mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 22:01:18 +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
|
@ -21,7 +21,7 @@ use std::fmt::Write;
|
|||
use ty_python_semantic::pull_types::pull_types;
|
||||
use ty_python_semantic::types::check_types;
|
||||
use ty_python_semantic::{
|
||||
Program, ProgramSettings, PythonPath, PythonPlatform, PythonVersionSource,
|
||||
Program, ProgramSettings, PythonEnvironmentPath, PythonPlatform, PythonVersionSource,
|
||||
PythonVersionWithSource, SearchPathSettings, SysPrefixPathOrigin,
|
||||
};
|
||||
|
||||
|
@ -271,15 +271,15 @@ fn run_test(
|
|||
src_roots: vec![src_path],
|
||||
extra_paths: configuration.extra_paths().unwrap_or_default().to_vec(),
|
||||
custom_typeshed: custom_typeshed_path.map(SystemPath::to_path_buf),
|
||||
python_path: configuration
|
||||
python_environment: configuration
|
||||
.python()
|
||||
.map(|sys_prefix| {
|
||||
PythonPath::IntoSysPrefix(
|
||||
PythonEnvironmentPath::explicit(
|
||||
sys_prefix.to_path_buf(),
|
||||
SysPrefixPathOrigin::PythonCliFlag,
|
||||
)
|
||||
})
|
||||
.unwrap_or(PythonPath::KnownSitePackages(vec![])),
|
||||
.unwrap_or(PythonEnvironmentPath::Testing(vec![])),
|
||||
}
|
||||
.to_search_paths(db.system(), db.vendored())
|
||||
.expect("Failed to resolve search path settings"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue