@@ -41,9 +41,7 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
41
41
# where ``setup`` is a function that does whatever is needed to set up the
42
42
# plugin, such as add items to various registries.
43
43
44
- import setuptools
45
- logger .info ("Loading external plugins using "
46
- "setuptools=={0}" .format (setuptools .__version__ ))
44
+ logger .info ("Loading external plugins" )
47
45
48
46
from glue ._plugin_helpers import iter_plugin_entry_points , PluginConfig
49
47
config = PluginConfig .load ()
@@ -72,21 +70,9 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
72
70
if not config .plugins [item .name ]:
73
71
continue
74
72
75
- # We don't use item.load() because that then checks requirements of all
76
- # the imported packages, which can lead to errors like this one that
77
- # don't really matter:
78
- #
79
- # Exception: (pytest 2.6.0 (/Users/tom/miniconda3/envs/py27/lib/python2.7/site-packages),
80
- # Requirement.parse('pytest>=2.8'), set(['astropy']))
81
- #
82
- # Just to be clear, this kind of error does indicate that there is an
83
- # old version of a package in the environment, but this can confuse
84
- # users as importing astropy directly would work (as setuptools then
85
- # doesn't do a stringent test of dependency versions). Often this kind
86
- # of error can occur if there is a conda version of a package and an
87
- # older pip version.
88
-
89
73
try :
74
+ # item.load() (importlib.metadata.EntryPoint.load) doesn't *always*
75
+ # return a module, so, using import_module is safer here.
90
76
module = import_module (item .module )
91
77
function = getattr (module , item .attr )
92
78
function ()
0 commit comments