Skip to content

Commit

Permalink
Merge pull request #86 from ninahakansson/change_version_handeling
Browse files Browse the repository at this point in the history
Use importlib to get version
  • Loading branch information
ninahakansson authored Jul 3, 2024
2 parents f35271d + 9792451 commit 2b5d1ae
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 <[email protected]>

"""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 2b5d1ae

Please sign in to comment.