From a3ccbb2d280baae531d4ce9ace390c37ab3dca0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:20:51 -0400 Subject: [PATCH 1/3] Update __init__.py --- src/pyrho/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyrho/__init__.py b/src/pyrho/__init__.py index 80dce69..3e6d87f 100644 --- a/src/pyrho/__init__.py +++ b/src/pyrho/__init__.py @@ -4,7 +4,7 @@ __email__ = "jmmshn@gmail.com" -from pkg_resources import DistributionNotFound, get_distribution +from importlib.resources import DistributionNotFound, get_distribution try: __version__ = get_distribution(__name__).version From ed3f821dbf491fd9a7e9ece117d5a86adddf4145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Tue, 24 Sep 2024 15:26:08 -0400 Subject: [PATCH 2/3] Update __init__.py --- src/pyrho/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pyrho/__init__.py b/src/pyrho/__init__.py index 3e6d87f..caed879 100644 --- a/src/pyrho/__init__.py +++ b/src/pyrho/__init__.py @@ -3,10 +3,9 @@ __author__ = """Jimmy Shen""" __email__ = "jmmshn@gmail.com" - -from importlib.resources import DistributionNotFound, get_distribution +from importlib.metadata import version, PackageNotFoundError try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: - pass + __version__ = version(__name__) +except PackageNotFoundError: + __version__ = "unknown" From 777e43ec17b802ab6afe3b04008abe084711d320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=C3=A1n=20Kavanagh?= <51478689+kavanase@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:03:52 -0400 Subject: [PATCH 3/3] Linting update --- src/pyrho/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyrho/__init__.py b/src/pyrho/__init__.py index caed879..717dd05 100644 --- a/src/pyrho/__init__.py +++ b/src/pyrho/__init__.py @@ -3,7 +3,7 @@ __author__ = """Jimmy Shen""" __email__ = "jmmshn@gmail.com" -from importlib.metadata import version, PackageNotFoundError +from importlib.metadata import PackageNotFoundError, version try: __version__ = version(__name__)