Replace deprecated pkg_resources
with stdlib
#239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
pkg_resources
has been deprecated bysetuptools
for quite a while: https://setuptools.pypa.io/en/latest/pkg_resources.htmlIt's got some bugs/warts:
So switch to using
importlib
functions which are part of the Python standard library as of3.8
.This is less error-prone, and also removes the need for
setuptools
to be installed in order for this panel to work.I realize we technically still support
3.7
, but I thought it was fine to change this particular panel to require3.8
, as3.7
support is best effort given that it's now EOL'd by the core Python team.I also removed the relative path location for specific libraries as it was simply blank for me on Python 3.12... I think showing the location of the site packages directory should suffice. If someone later wants to build this out further, they're more than welcome to.
Note that
importlib.metadata.distributions()
does have an outstanding issue that it reports a local editable install twice, but they plan to eventually fix that: