Skip to content

Commit

Permalink
Just use pkg_resources.get_distribution to obtain version string
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Nov 16, 2020
1 parent 4abc45c commit fd306db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pygmt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import atexit as _atexit

from pkg_resources import get_distribution
from _version import version as __version__

# Import modules to make the high-level GMT Python API
from .session_management import begin as _begin, end as _end
Expand All @@ -24,8 +23,9 @@
from .x2sys import x2sys_init, x2sys_cross
from . import datasets

# Get the version SHA hash
__commit__ = get_distribution("pygmt").version.split("+g")[-1]
# Get semantic version through setuptools-scm
__version__ = f'v{get_distribution("pygmt").version}' # e.g. v0.1.2.dev3+g0ab3cd78
__commit__ = __version__.split("+g")[-1] # 0ab3cd78

# Start our global modern mode session
_begin()
Expand Down

0 comments on commit fd306db

Please sign in to comment.