From 4f13477e1263ece1f58ca8c1745b2e3212b88cf5 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Fri, 10 Nov 2023 01:20:56 -0500 Subject: [PATCH 1/2] Use importlib instead of deprecated pkg_resources --- drizzle/__init__.py | 6 +++--- setup.py | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drizzle/__init__.py b/drizzle/__init__.py index 70341a84..9418e47b 100644 --- a/drizzle/__init__.py +++ b/drizzle/__init__.py @@ -1,11 +1,11 @@ """ A package for combining dithered images into a single image """ +from importlib.metadata import PackageNotFoundError, version -from pkg_resources import get_distribution, DistributionNotFound try: - __version__ = get_distribution(__name__).version -except DistributionNotFound: + __version__ = version(__name__) +except PackageNotFoundError: # package is not installed __version__ = 'unknown' diff --git a/setup.py b/setup.py index 62a586c9..3b1665d4 100755 --- a/setup.py +++ b/setup.py @@ -35,4 +35,7 @@ def get_extensions(): return [Extension(str('drizzle.cdrizzle'), sources, **cfg)] -setup(ext_modules=get_extensions()) +setup( + ext_modules=get_extensions(), + python_requires='>=3.7' +) From 25e6a41612f9011c37a1dfb52d7b18735d725e21 Mon Sep 17 00:00:00 2001 From: Mihai Cara Date: Fri, 10 Nov 2023 01:25:06 -0500 Subject: [PATCH 2/2] pep8 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3b1665d4..d2aaf128 100755 --- a/setup.py +++ b/setup.py @@ -37,5 +37,5 @@ def get_extensions(): setup( ext_modules=get_extensions(), - python_requires='>=3.7' + python_requires='>=3.7', )