File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 1313from pip ._internal .commands import create_command
1414from pip ._internal .exceptions import PipError
1515from pip ._internal .utils import deprecation
16+ from pip ._internal .utils .plugins import load_plugins
1617
1718logger = logging .getLogger (__name__ )
1819
@@ -77,4 +78,6 @@ def main(args: Optional[List[str]] = None) -> int:
7778 logger .debug ("Ignoring error %s when setting locale" , e )
7879 command = create_command (cmd_name , isolated = ("--isolated" in cmd_args ))
7980
81+ load_plugins ()
82+
8083 return command .main (cmd_args )
Original file line number Diff line number Diff line change 77from pip ._internal .models .plugin import DistInspectorPlugin , Plugin , plugin_from_module
88
99logger = logging .getLogger (__name__ )
10-
1110_loaded_plugins : List [Plugin ] = []
1211
1312
@@ -24,15 +23,16 @@ def iter_entry_points(group_name: str) -> EntryPoints:
2423 return groups .get (group_name , [])
2524
2625
27- for entrypoint in iter_entry_points (group_name = "pip.plugins" ):
28- try :
29- module = entrypoint .load ()
30- except ModuleNotFoundError :
31- logger .warning ("Tried to load plugin %s but failed" , entrypoint .name )
32- continue
33- plugin = plugin_from_module (entrypoint .name , module )
34- if plugin is not None :
35- _loaded_plugins .append (plugin )
26+ def load_plugins () -> None :
27+ for entrypoint in iter_entry_points (group_name = "pip.plugins" ):
28+ try :
29+ module = entrypoint .load ()
30+ except ModuleNotFoundError :
31+ logger .warning ("Tried to load plugin %s but failed" , entrypoint .name )
32+ continue
33+ plugin = plugin_from_module (entrypoint .name , module )
34+ if plugin is not None :
35+ _loaded_plugins .append (plugin )
3636
3737
3838@contextlib .contextmanager
You can’t perform that action at this time.
0 commit comments