[ty] Support ephemeral uv virtual environments (#18335)

This commit is contained in:
Alex Waygood 2025-05-28 15:54:59 +01:00 committed by GitHub
parent 9925910a29
commit a5ebb3f3a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 283 additions and 97 deletions

View file

@ -14,7 +14,9 @@ use ruff_python_ast::PythonVersion;
use crate::db::Db;
use crate::module_name::ModuleName;
use crate::module_resolver::typeshed::{TypeshedVersions, vendored_typeshed_versions};
use crate::site_packages::{PythonEnvironment, SitePackagesDiscoveryError, SysPrefixPathOrigin};
use crate::site_packages::{
PythonEnvironment, SitePackagesDiscoveryError, SitePackagesPaths, SysPrefixPathOrigin,
};
use crate::{Program, PythonPath, SearchPathSettings};
use super::module::{Module, ModuleKind};
@ -289,7 +291,7 @@ impl SearchPaths {
virtual_env_path,
error
);
vec![]
SitePackagesPaths::default()
};
match PythonEnvironment::new(
@ -304,7 +306,7 @@ impl SearchPaths {
}
} else {
tracing::debug!("No virtual environment found");
vec![]
SitePackagesPaths::default()
}
}