From 17e496926e9c38f5eb28fa55e34d12fb3e1b21d5 Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 18 Jun 2024 18:01:53 +0200 Subject: [PATCH] fix import error --- src/actinia_parallel_plugin/__init__.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/actinia_parallel_plugin/__init__.py b/src/actinia_parallel_plugin/__init__.py index bb92c58..07ad8e0 100644 --- a/src/actinia_parallel_plugin/__init__.py +++ b/src/actinia_parallel_plugin/__init__.py @@ -25,13 +25,11 @@ __maintainer__ = "mundialis GmbH % Co. KG" -from pkg_resources import get_distribution, DistributionNotFound +import importlib.metadata try: # Change here if project is renamed and does not equal the package name dist_name = __name__ - __version__ = get_distribution(dist_name).version -except DistributionNotFound: + __version__ = importlib.metadata.version(dist_name) +except Exception: __version__ = "unknown" -finally: - del get_distribution, DistributionNotFound