[ty] Add "list modules" implementation

The actual implementation wasn't too bad. It's not long
but pretty fiddly. I copied over the tests from the existing
module resolver and adapted them to work with this API. Then
I added a number of my own tests as well.
This commit is contained in:
Andrew Gallant 2025-08-12 14:14:31 -04:00 committed by Andrew Gallant
parent ec7c2efef9
commit 4db20f459c
3 changed files with 1679 additions and 2 deletions

View file

@ -7,8 +7,8 @@ use crate::suppression::{INVALID_IGNORE_COMMENT, UNKNOWN_RULE, UNUSED_IGNORE_COM
pub use db::Db;
pub use module_name::ModuleName;
pub use module_resolver::{
Module, SearchPathValidationError, SearchPaths, resolve_module, resolve_real_module,
system_module_search_paths,
Module, SearchPath, SearchPathValidationError, SearchPaths, list_modules, resolve_module,
resolve_real_module, system_module_search_paths,
};
pub use program::{
Program, ProgramSettings, PythonVersionFileSource, PythonVersionSource,