Skip to content

Commit

Permalink
update and inline comment
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Jan 6, 2025
1 parent e0c301e commit c609884
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions glue/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,9 @@ def load_plugins(splash=None, require_qt_plugins=False, plugins_to_load=None):
if not config.plugins[item.name]:
continue

# We don't use item.load() because that then checks requirements of all
# the imported packages, which can lead to errors like this one that
# don't really matter:
#
# Exception: (pytest 2.6.0 (/Users/tom/miniconda3/envs/py27/lib/python2.7/site-packages),
# Requirement.parse('pytest>=2.8'), set(['astropy']))
#
# Just to be clear, this kind of error does indicate that there is an
# old version of a package in the environment, but this can confuse
# users as importing astropy directly would work (as setuptools then
# doesn't do a stringent test of dependency versions). Often this kind
# of error can occur if there is a conda version of a package and an
# older pip version.

try:
# item.load() (importlib.metadata.EntryPoint.load) doesn't *always*
# return a module, so, using import_module is safer here.
module = import_module(item.module)
function = getattr(module, item.attr)
function()
Expand Down

0 comments on commit c609884

Please sign in to comment.