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
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.
The text was updated successfully, but these errors were encountered:
Description of the problem
pygmt/pygmt/__init__.py
Line 23 in 24600ee
In
__init__.py
, we use theget_distribution
function from the pkg_resources module to get the version string of the PyGMT package.It seems,
pkg_resources
is no longer recommended.https://setuptools.pypa.io/en/latest/pkg_resources.html
https://github.com/pypa/setuptools_scm#retrieving-package-version-at-runtime
I think we should use
importlib.metadata
instead: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.The text was updated successfully, but these errors were encountered: