1212
1313 get_method
1414"""
15- import importlib
15+ from importlib . metadata import entry_points
1616
1717from pysteps .decorators import postprocess_import
1818from pysteps .io import importers , exporters , interface
@@ -46,17 +46,11 @@ def discover_importers():
4646 The importers found are added to the `pysteps.io.interface_importer_methods`
4747 dictionary containing the available importers.
4848 """
49- # The pkg resources needs to be reload to detect new packages installed during
50- # the execution of the python application. For example, when the plugins are
51- # installed during the tests
52- import pkg_resources
53-
54- importlib .reload (pkg_resources )
5549 # Backward compatibility with previous entry point 'pysteps.plugins.importers' next to 'pysteps.plugins.importer'
5650 for entry_point in list (
57- pkg_resources . iter_entry_points (group = "pysteps.plugins.importer" , name = None )
51+ entry_points (group = "pysteps.plugins.importer" )
5852 ) + list (
59- pkg_resources . iter_entry_points (group = "pysteps.plugins.importers" , name = None )
53+ entry_points (group = "pysteps.plugins.importers" )
6054 ):
6155 _importer = entry_point .load ()
6256
@@ -71,14 +65,14 @@ def discover_importers():
7165 RuntimeWarning (
7266 f"The importer identifier '{ importer_short_name } ' is already available in"
7367 "'pysteps.io.interface._importer_methods'.\n "
74- f"Skipping { entry_point .module_name } :{ entry_point .attrs } "
68+ f"Skipping { entry_point .module } :{ entry_point .attr } "
7569 )
7670
7771 if hasattr (importers , importer_function_name ):
7872 RuntimeWarning (
7973 f"The importer function '{ importer_function_name } ' is already an attribute"
8074 "of 'pysteps.io.importers`.\n "
81- f"Skipping { entry_point .module_name } :{ entry_point .attrs } "
75+ f"Skipping { entry_point .module } :{ entry_point .attr } "
8276 )
8377 else :
8478 setattr (importers , importer_function_name , _importer )
0 commit comments