From 484064b1961feb55e8a942c7098989f149189baf Mon Sep 17 00:00:00 2001 From: Balthasar Reuter Date: Tue, 10 Dec 2024 21:34:22 +0100 Subject: [PATCH] Replace pkg_resources with importlib for Py 3.12+ compatibility --- ifsbench/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ifsbench/__init__.py b/ifsbench/__init__.py index a21d5f1..05ca20a 100644 --- a/ifsbench/__init__.py +++ b/ifsbench/__init__.py @@ -11,7 +11,7 @@ This package contains Python utilities to run and benchmark the IFS. """ -from pkg_resources import get_distribution, DistributionNotFound +from importlib.metadata import version, PackageNotFoundError from .arch import * # noqa from .benchmark import * # noqa @@ -31,7 +31,7 @@ from .util import * # noqa try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: + __version__ = version("ifsbench") +except PackageNotFoundError: # package is not installed pass