[red-knot] Add basic workspace support (#12318)

This commit is contained in:
Micha Reiser 2024-07-17 11:34:21 +02:00 committed by GitHub
parent 0c72577b5d
commit 91338ae902
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 1018 additions and 664 deletions

View file

@ -162,11 +162,9 @@ impl HasTy for ast::Alias {
#[cfg(test)]
mod tests {
use red_knot_module_resolver::{
set_module_resolution_settings, RawModuleResolutionSettings, TargetVersion,
};
use ruff_db::files::system_path_to_file;
use ruff_db::parsed::parsed_module;
use ruff_db::program::{Program, SearchPathSettings, TargetVersion};
use ruff_db::system::{DbWithTestSystem, SystemPathBuf};
use crate::db::tests::TestDb;
@ -174,15 +172,15 @@ mod tests {
use crate::{HasTy, SemanticModel};
fn setup_db() -> TestDb {
let mut db = TestDb::new();
set_module_resolution_settings(
&mut db,
RawModuleResolutionSettings {
let db = TestDb::new();
Program::new(
&db,
TargetVersion::Py38,
SearchPathSettings {
extra_paths: vec![],
workspace_root: SystemPathBuf::from("/src"),
site_packages: None,
custom_typeshed: None,
target_version: TargetVersion::Py38,
},
);