diff --git a/pepper/__init__.py b/pepper/__init__.py index 267c5e2..fe20b91 100644 --- a/pepper/__init__.py +++ b/pepper/__init__.py @@ -1,15 +1,15 @@ ''' Pepper is a CLI front-end to salt-api ''' -import pkg_resources +from importlib.metadata import PackageNotFoundError, version from pepper.libpepper import Pepper, PepperException __all__ = ('__version__', 'Pepper', 'PepperException') try: - __version__ = pkg_resources.get_distribution('salt_pepper').version -except pkg_resources.DistributionNotFound: + __version__ = version('salt_pepper') +except PackageNotFoundError: # package is not installed __version__ = None