Skip to content

Commit

Permalink
Merge pull request #137 from bioembeddings/master
Browse files Browse the repository at this point in the history
Replace pkg_resources with importlib.metadata
  • Loading branch information
jamestwebber authored Jul 21, 2022
2 parents 58c14a2 + 43ba549 commit 097176a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pynndescent/__init__.py
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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")
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": {},
Expand Down

0 comments on commit 097176a

Please sign in to comment.