File tree 2 files changed +13
-10
lines changed
2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 13
13
from pip ._internal .commands import create_command
14
14
from pip ._internal .exceptions import PipError
15
15
from pip ._internal .utils import deprecation
16
+ from pip ._internal .utils .plugins import load_plugins
16
17
17
18
logger = logging .getLogger (__name__ )
18
19
@@ -77,4 +78,6 @@ def main(args: Optional[List[str]] = None) -> int:
77
78
logger .debug ("Ignoring error %s when setting locale" , e )
78
79
command = create_command (cmd_name , isolated = ("--isolated" in cmd_args ))
79
80
81
+ load_plugins ()
82
+
80
83
return command .main (cmd_args )
Original file line number Diff line number Diff line change 7
7
from pip ._internal .models .plugin import DistInspectorPlugin , Plugin , plugin_from_module
8
8
9
9
logger = logging .getLogger (__name__ )
10
-
11
10
_loaded_plugins : List [Plugin ] = []
12
11
13
12
@@ -24,15 +23,16 @@ def iter_entry_points(group_name: str) -> EntryPoints:
24
23
return groups .get (group_name , [])
25
24
26
25
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 )
36
36
37
37
38
38
@contextlib .contextmanager
You can’t perform that action at this time.
0 commit comments