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
{{ message }}
Repository navigation
Replace pkg_resources with importlib.metadata #1672
Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (resources, metadata). Please consider using those libraries instead of pkg_resources.
Alternatively, you can use pkg_resources which is included in setuptools (but has a significant runtime cost):
I think we should use importlib.metadata instead:
from importlib.metadata import version
__version__ = version("pygmt")
The importlib.metadata module was added in Python 3.8, but PyGMT currently still supports Python 3.7. Luckily, we're going to drop Python 3.7 support on Dec. 26, 2021 as per NEP29, so it won't be a problem for us.
Activity
Replace pkg_resources with importlib.metadata
weiji14 commentedon Dec 20, 2021
Closed by #1674