-
Notifications
You must be signed in to change notification settings - Fork 7
Description
This was a helpful example repo. I just have one request.
In Python 3.12 they updated importlib.resources.files(): https://docs.python.org/3/library/importlib.resources.html#importlib.resources.files
Changed in version 3.12: package parameter was renamed to anchor. anchor can now be a non-package module and if omitted will default to the caller’s module. package is still accepted for compatibility but will raise a DeprecationWarning. Consider passing the anchor positionally or using importlib_resources >= 5.10 for a compatible interface on older Pythons.
Could you include an example of omitting anchor so that it defaults to the caller’s module (or explicitly passing the module name with a string literal or __name__
? I tried myself and while it works before packaging with zipapp, it fails to open and read the data file when running the zip. I'm not sure if I'm doing something wrong.