Closed
Description
In #60, I encountered an issue where importlib resources was unable to supply an interface for modules that wish to load neighboring resources. I've encountered another use-case where it's not straightforward to replace the pkg_resources usage with importlib.resources.
Again, in this case, because the test module isn't in a package, importlib resources doesn't support it, but pkg_resources
does. The current workarounds include:
- make the
tests
directory a proper package. However, doing this also causes that package to get discovered as a package. - assume the files are on a local file system and access
__file__
to infer the location of nearby resources.
In my opinion, if 'importlib' supports importing non-package modules, 'importlib resources' should support loading resources pertinent to those modules.
Metadata
Metadata
Assignees
Labels
No labels