02/26/2023, 3:23 PM
Hi, is it possible to figure out the source root for a given python module, if you have list of source roots and modules?
02/26/2023, 3:43 PM
That's exactly what dependency inference does.
02/26/2023, 4:10 PM
Do you have the module as a filesystem path or as a dotted import string?
I'm assuming the latter?
02/26/2023, 4:32 PM
02/26/2023, 9:10 PM
And you're doing this in a plugin? Then yeah take a look at dep inference implementation, which maps modules to source paths, and then it's easy to map source paths to their source roots.