ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
121 stars 77 forks source link

discover_modes emits DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. #1034

Closed pllim closed 1 year ago

pllim commented 1 year ago

Saw this in astrowidgets dev testing (https://github.com/astropy/astrowidgets/pull/156). Also see https://github.com/python/importlib_metadata/issues/298 . I am going to ignore this warning downstream but you might want to consider addressing it here.

Example log: https://github.com/astropy/astrowidgets/actions/runs/3659056477/jobs/6184616525

>       iw = ImageWidget()

../../astrowidgets/tests/test_image_widget.py:268: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../astrowidgets/core.py:76: in __init__
    self._viewer = EnhancedCanvasView(logger=logger)
.../ginga/web/jupyterw/ImageViewJpw.py:417: in __init__
    ImageViewZoom.__init__(self, logger=logger, settings=settings,
.../ginga/web/jupyterw/ImageViewJpw.py:400: in __init__
    self.set_bindings(bindings)
.../ginga/web/jupyterw/ImageViewJpw.py:410: in set_bindings
    bindings.set_bindings(self)
.../ginga/Bindings.py:89: in set_bindings
    self.setup_settings_events(viewer, bindmap)
.../ginga/Bindings.py:157: in setup_settings_events
    from ginga.modes.modeinfo import available_modes
.../ginga/modes/modeinfo.py:60: in <module>
    discover_modes()
.../ginga/modes/modeinfo.py:30: in discover_modes
    discovered_modes = entry_points().get(group, [])
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = {'array_api': [EntryPoint(name='numpy', value='numpy.array_api', group='array_api')],
        'asdf_extensions': [EntryPoint(n..._finalize', value='setuptools.dist:_Distribution.finalize_options',
                                       group='setuptools.finalize_distribution_options')]}
name = 'ginga_modes', default = []

    def get(self, name, default=None):
>       self._warn()
E       DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.

.../python3.11/importlib/metadata/__init__.py:443: DeprecationWarning