Replace pkg_resources with importlib_metadata#2354
Conversation
| 'ghp-import>=1.0', | ||
| 'pyyaml_env_tag>=0.1' | ||
| 'pyyaml_env_tag>=0.1', | ||
| 'importlib_metadata>=3.10' |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
There was a problem hiding this comment.
No, the API changes in Python 3.10 and we are using the new API. Therefore, we need the backport for all supported versions of Python (3.6-3.9).
There was a problem hiding this comment.
From the docs:
Compatibility Note
The “selectable” entry points were introduced in
importlib_metadata3.6 and Python 3.10. Prior to those changes,entry_pointsaccepted no parameters and always returned a dictionary of entry points, keyed by group. For compatibility, if no parameters are passed to entry_points, aSelectableGroupsobject is returned, implementing that dict interface. In the future, callingentry_pointswith no parameters will return anEntryPointsobject. Users should rely on the selection interface to retrieve entry points by group.
Note that we are calling entry_points with the group parameter, which is using the new API (the "selection interface"), which is recommended.
There was a problem hiding this comment.
While the change was introduced in 3.6 of the backport (as noted above), there have been various improvements to the new API up through version 3.10. Therefore we are requiring importlib_metadata>=3.10.
There was a problem hiding this comment.
By the way, I had intended to include an explanation in the commit message. So thanks for the reminder.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
|
The docs state:
So I find it interesting that the opposite effect is observed. |
This comment was marked as abuse.
This comment was marked as abuse.
As per discussion on mkdocs#2347 our new babel code base should be migrated to not require setuptools and use importlib_metadata instead
Related to #2347.