Skip to content

Commit

Permalink
Use importlib_metadata instead of pkgresources
Browse files Browse the repository at this point in the history
  • Loading branch information
francisco-dlp committed Apr 14, 2021
1 parent 4632be7 commit e0f798f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hyperspy/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
import logging
import copy
import pkgutil
import pkg_resources
import yaml

from pathlib import Path
import importlib_metadata as metadata


_logger = logging.getLogger(__name__)
Expand All @@ -37,8 +37,8 @@
ALL_EXTENSIONS = copy.deepcopy(EXTENSIONS)

_external_extensions = [
entry_point.module_name
for entry_point in pkg_resources.iter_entry_points('hyperspy.extensions')]
entry_point.module
for entry_point in metadata.entry_points()['hyperspy.extensions']]

for _external_extension_mod in _external_extensions:
_logger.info("Enabling extension %s" % _external_extension_mod)
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
'prettytable',
'tifffile>=2018.10.18',
'numba',
# included in stdlib since v3.8, but this required version requires Python 3.9
'importlib_metadata>=1.6.0',
]

extras_require = {
Expand Down

0 comments on commit e0f798f

Please sign in to comment.