Skip to content

Commit

Permalink
Fix __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
sinhaharsh committed Feb 6, 2024
1 parent 5f24ee8 commit b5bfe9a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions MRdataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# __version__ = '0.1.0'
import logging
import sys

from MRdataset.config import configure_logger

Expand All @@ -22,5 +23,12 @@
try:
from MRdataset._version import __version__
except ImportError:
raise ImportError('It seems MRdataset is not installed correctly. Use pip '
' to install it first.')
if sys.version_info < (3, 8):
from importlib_metadata import version
else:
from importlib.metadata import version

try:
__version__ = version('MRdataset')
except Exception:
__version__ = "unknown"

0 comments on commit b5bfe9a

Please sign in to comment.