(
&mut self,
python_version: PythonVersion,
)
| 700 | } |
| 701 | |
| 702 | pub fn init_program_with_python_version( |
| 703 | &mut self, |
| 704 | python_version: PythonVersion, |
| 705 | ) -> anyhow::Result<()> { |
| 706 | let root = self.project().root(self); |
| 707 | |
| 708 | let search_paths = SearchPathSettings::new(vec![root.to_path_buf()]) |
| 709 | .to_search_paths(self.system(), self.vendored(), &FallibleStrategy) |
| 710 | .expect("Valid search path settings"); |
| 711 | |
| 712 | self.files().try_add_root(self, root, FileRootKind::Project); |
| 713 | |
| 714 | Program::from_settings( |
| 715 | self, |
| 716 | ProgramSettings { |
| 717 | python_version: PythonVersionWithSource { |
| 718 | source: ty_python_semantic::PythonVersionSource::Default, |
| 719 | version: python_version, |
| 720 | }, |
| 721 | python_platform: PythonPlatform::default(), |
| 722 | search_paths, |
| 723 | }, |
| 724 | ); |
| 725 | |
| 726 | Ok(()) |
| 727 | } |
| 728 | } |
| 729 | |
| 730 | impl TestDb { |
no test coverage detected