-
-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migrate pgk_resources to importlib_resources #1968
migrate pgk_resources to importlib_resources #1968
Conversation
@saulpw @anjakefala before I try to fix the version problems... what do you think of this in general? regarding the version problems... |
Ok I realised my mistake. The warning only pops up when launching via the installed
I'm not even sure how this file is generated, but I'd be curious to find out & maybe also remove the |
Ahhh, thank you for tackling this @zormit! And researching what needed to change. I think I learned that |
Failing now because |
Seems like we need a try/except to use importlib.resources.files > Python 3.9, and |
Upon further research, it seems like pkgutil can possibly give us what we want without the version challenges with |
f118bfa
to
38d4d5f
Compare
I decided to go with |
38d4d5f
to
451f52c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @zormit and @anjakefala ! If everything seems to work, this is good.
Thanks for the review @anjakefala and pulling it through! :) |
Motivation
While playing around with the codebase, I saw a warning pop up (weirdly I'm having trouble to reproduce it right now) that
pgk_resources
is deprecated. It's not an important thing, but I took it as a small first issue to get a bit used to the codebase and the contribution mechanism again :)Approach
When following the link in the warning, you'll be able to find a migration guide, which I partly followed.
Side-Effects
This probably closes #1911, because the dependency on
pkg_resources
is gone.Open Questions
importlib.resources.as_file
in some of the places.