diff --git a/pynndescent/__init__.py b/pynndescent/__init__.py index f5a66be..5aaafa4 100644 --- a/pynndescent/__init__.py +++ b/pynndescent/__init__.py @@ -1,7 +1,14 @@ -import pkg_resources +import sys + import numba + from .pynndescent_ import NNDescent, PyNNDescentTransformer +if sys.version_info[:2] >= (3, 8): + import importlib.metadata as importlib_metadata +else: + import importlib_metadata + # Workaround: https://github.com/numba/numba/issues/3341 if numba.config.THREADING_LAYER == "omp": try: @@ -12,4 +19,4 @@ # might be a missing symbol due to e.g. tbb libraries missing numba.config.THREADING_LAYER = "workqueue" -__version__ = pkg_resources.get_distribution("pynndescent").version +__version__ = importlib_metadata.version("pynndescent") diff --git a/setup.py b/setup.py index ebf61dd..6fc5a28 100644 --- a/setup.py +++ b/setup.py @@ -42,6 +42,7 @@ def readme(): "numba >= 0.51.2", "llvmlite >= 0.30", "joblib >= 0.11", + 'importlib-metadata >= 4.8.1; python_version < "3.8"', ], "ext_modules": [], "cmdclass": {},