Convert away from pkg_resources
matteius opened this issue · comments
I was working on converting pipenv
away from pkg_resources
to use instead distributions from https://docs.python.org/3/library/importlib.metadata.htmland in the past hour it became problematic because we rely on pipdeptree
which is expecting we are working with pkg_resources
Distriubtions. The problem as I see it is the pkg_resources documentation https://setuptools.pypa.io/en/latest/pkg_resources.html has this attention marker:
Attention
Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (importlib_resources, importlib_metadata). Please consider using those libraries instead of pkg_resources
I started working on this in the first place because of some edge case where some users cannot import pkg_resources. Are there any plans to convert away from pkg_resources in this project?
I noticed that there are also some pkg_resources used in source.
I think this need to be continued.
PR for this is welcome 😊
I have submitted the code for this part, and due to API changes, the results may vary. I still have some unresolved issues, but I've gone ahead and submitted it first. Please help me with a code review if you have time, thank you. @gaborbernat
Fixed by #333.