Disuse pkg_resources in favor of importlib.metadata #1061
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 is deprecated. Importlib.metadata is the new standard way of dealing with distribution metadata: entry points, versions, etc.
This PR eliminates our usage of
pkg_resources
in favor ofimportlib.metadata
(orimportlib_metadata
for python < 3.10 — in this PR we useimportlib.metadata.packages_distributions()
which is only available in 3.10.)Issue(s) Resolved
This would have sort of fixed the issue noted in #1058 having to do with the misspelling of a dependency. (The real problem there was the misspelling; however, using the same distribution grokking machinery as python itself uses helps minimize weirdness due to differences in behavior between the import system and the introspection system.)
Related Issues / Links
Description of Changes