Skip to content

Commit

Permalink
Removed pkg_resources as a dependency (#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlaw authored Feb 2, 2024
1 parent 514eb29 commit f8f245c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions stumpy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os.path
from importlib.metadata import distribution
from site import getsitepackages

from numba import cuda
from pkg_resources import DistributionNotFound, get_distribution

from .aamp import aamp # noqa: F401
from .aamp_mmotifs import aamp_mmotifs # noqa: F401
Expand Down Expand Up @@ -182,14 +183,15 @@
gpu_aamp_stimp.__doc__ = ast.get_docstring(cd)

try:
_dist = get_distribution("stumpy")
# _dist = get_distribution("stumpy")
_dist = distribution("stumpy")
# Normalize case for Windows systems
dist_loc = os.path.normcase(_dist.location)
dist_loc = os.path.normcase(getsitepackages()[0])
here = os.path.normcase(__file__)
if not here.startswith(os.path.join(dist_loc, "stumpy")):
# not installed, but there is another version that *is*
raise DistributionNotFound # pragma: no cover
except DistributionNotFound: # pragma: no cover
raise ModuleNotFoundError # pragma: no cover
except ModuleNotFoundError: # pragma: no cover
__version__ = "Please install this project with setup.py"
else: # pragma: no cover
__version__ = _dist.version

0 comments on commit f8f245c

Please sign in to comment.