Closed Rubo3 closed 1 year ago
this raises our minimum python version to 3.9 - is there an alternative which is still more modern than pkg_resources
? Which I agree needs to go.
Since you look for files in the same directory of the module, what about
from pathlib import Path
...
return CollectionDB.from_path(Path(__file__).parent / name)
pathlib
was introduced in Python 3.4.
huh, I assumed there was some reason why a package-relative path was necessary...but you're right pathlib
seems to work fine here. Not sure why that wasn't used from the beginning.
Please tell me when you're ready to merge this PR. Thanks.
Thank you!
This patch fixes the warnings I get when running the tests, by using
importlib.resources.files
instead ofpkg_resources.resource_filename
. All of them pass.