What’s annoying is that this is both supported and easy to do in importlib.resources
’s now-deprecated (but still usable) predecessor pkg_resources:
resource_filename(package_or_requirement, resource_name)
[…] If the named resource is a directory, then all resources within that directory (including subdirectories) are also extracted. […]
Then in importlib.resources
, it’s explicitly not supported for some reason…
Does anyone know why this feature was dropped? It would be good to know so that if it’s something fundamental, nobody will waste time writing a PR (and conversely if the only reason is “nobody got around to implementing it yet”).
This seemed like it might be related at first glance, but is actually just about files inside resource directories, not the directories themselves.