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
pkg_resources is deprecated, it would be nice have the docs clarify how to use click-plugins with importlib_metadata / importlib.metadata instead.
ATTENTION
Use of pkg_resources is deprecated in favor of importlib.resources, importlib.metadata and their backports (importlib_resources, importlib_metadata). Some useful APIs are also provided by packaging (e.g. requirements and version parsing). Users should refrain from new usage of pkg_resources and should work to port to importlib-based solutions.
I've replaced this:
frompkg_resourcesimportiter_entry_pointsimportclickfromclick_pluginsimportwith_plugins@with_plugins(iter_entry_points('core_package.cli_plugins'))@click.group()defcli():
"""Commandline interface for yourpackage."""
with this:
importclickfromclick_pluginsimportwith_pluginsfromimportlib_metadataimportentry_points@with_plugins(entry_points(group='core_package.cli_plugins'))@click.group()defcli():
"""Commandline interface for yourpackage."""
The above code is compatible with importlib-metadata>=3.6
The text was updated successfully, but these errors were encountered:
pkg_resources
is deprecated, it would be nice have the docs clarify how to useclick-plugins
withimportlib_metadata
/importlib.metadata
instead.I've replaced this:
with this:
The above code is compatible with
importlib-metadata>=3.6
The text was updated successfully, but these errors were encountered: