Skip to content

Commit

Permalink
Use importlib.metadata meta data to get the version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nina.Hakansson committed Apr 15, 2024
1 parent 39dae4d commit 9792451
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions level1c4pps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
# Nina Hakansson <nina.hakansson@smhi.se>

"""Package Initializer for level1c4pps."""

from pkg_resources import get_distribution, DistributionNotFound
from importlib.metadata import version
import numpy as np
import xarray as xr
from datetime import datetime
Expand All @@ -38,11 +37,8 @@
datefmt='%H:%M:%S')
logger = logging.getLogger('level1c4pps')
xr.set_options(keep_attrs=True)
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass

__version__ = version(__name__)

PPS_TAGNAMES_TO_IMAGE_NR = {'ch_r06': 'image1',
'ch_r09': 'image2',
Expand Down

0 comments on commit 9792451

Please sign in to comment.