Skip to content

Commit

Permalink
Updating how we get version information from pkg metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
phargogh committed Nov 4, 2023
1 parent 03d3c45 commit 1e8eeaa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/natcap/invest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
"""init module for natcap.invest."""
import importlib.metadata
import logging
import os
import sys
from gettext import translation

import babel
import pkg_resources

LOGGER = logging.getLogger('natcap.invest')
LOGGER.addHandler(logging.NullHandler())
__all__ = ['local_dir', ]

try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = importlib.metadata.version('natcap.invest')
except importlib.metadata.PackageNotFoundError:
# package is not installed. Log the exception for debugging.
LOGGER.exception('Could not load natcap.invest version information')

Expand Down

0 comments on commit 1e8eeaa

Please sign in to comment.