You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Switch off of deprecated pkg_resources library #676
After reading the related docs/blogs shared below I think we should choose importlib_resources library which is developed and maintained by Python developers and fixes the architecture issues related to importlib.resources module which is going to be deprecated in Python 3.11 as discussed here
@farhan , thanks for the research. I took a look at the Python forum post and came to the conclusion that:
pkg_resources is what we use now. It is deprecated but will still work in Python 3.11.
importlib.resources was introduced in Python 3.7, but its API had design problems.
importlib_resources is a better, redesigned version of that API, available in Python 3.3+.
In Python 3.11, importlib_resources becomes official, as importlib.resources, thus deprecating the old, problematic version of the API.
So, it sounds like we could wait until edx-platform is upgraded to Python 3.11, and then just switch directly to the new, official importlib.resources package. Does that sound good?
As an additional note, it looks like pkg_resources is still around in 3.12 so it will be safe to jump to that as well so I think we can de-prioritize this until after the python upgrade which we'll hopefully kick-off soon.
Activity
farhan commentedon Feb 1, 2024
After reading the related docs/blogs shared below I think we should choose importlib_resources library which is developed and maintained by Python developers and fixes the architecture issues related to importlib.resources module which is going to be deprecated in Python 3.11 as discussed here
Docs/Blogs
https://discuss.python.org/t/deprecating-importlib-resources-legacy-api/11386
https://importlib-resources.readthedocs.io/en/latest/using.html
https://docs.python.org/3/library/importlib.resources.html
https://www.geeksforgeeks.org/importlib-package-in-python/
https://dev.to/bowmanjd/easily-load-non-python-data-files-from-a-python-package-2e8g
FYI @kdmccormick @feanil
kdmccormick commentedon Feb 1, 2024
@farhan , thanks for the research. I took a look at the Python forum post and came to the conclusion that:
pkg_resourcesis what we use now. It is deprecated but will still work in Python 3.11.importlib.resourceswas introduced in Python 3.7, but its API had design problems.importlib_resourcesis a better, redesigned version of that API, available in Python 3.3+.importlib_resourcesbecomes official, asimportlib.resources, thus deprecating the old, problematic version of the API.So, it sounds like we could wait until edx-platform is upgraded to Python 3.11, and then just switch directly to the new, official
importlib.resourcespackage. Does that sound good?feanil commentedon Feb 1, 2024
As an additional note, it looks like pkg_resources is still around in 3.12 so it will be safe to jump to that as well so I think we can de-prioritize this until after the python upgrade which we'll hopefully kick-off soon.
farhan commentedon Jun 10, 2024
PR is blocked as we are waiting for drop of Python
v3.8support from edx-platform