MCPcopy Index your code
hub / github.com/modelscope/modelscope / uninstall_plugins

Method uninstall_plugins

modelscope/utils/plugins.py:1033–1061  ·  view source on GitHub ↗

uninstall plugins Args: uninstall_args: args used to uninstall by pip command is_yes: force yes without verified Returns: status code, and uninstall args

(self,
                          uninstall_args: Union[str, List],
                          is_yes=False)

Source from the content-addressed store, hash-verified

1031 return installed_package
1032
1033 def uninstall_plugins(self,
1034 uninstall_args: Union[str, List],
1035 is_yes=False):
1036 """
1037 uninstall plugins
1038 Args:
1039 uninstall_args: args used to uninstall by pip command
1040 is_yes: force yes without verified
1041
1042 Returns: status code, and uninstall args
1043
1044 """
1045 if is_yes is not None:
1046 uninstall_args += ['-y']
1047
1048 status_code, options, args = PluginsManager.pip_command(
1049 'uninstall',
1050 uninstall_args,
1051 )
1052
1053 if status_code == 0:
1054 logger.info(f'The plugins {",".join(args)} is uninstalled')
1055
1056 # TODO Add Ast index for ast update record
1057
1058 # Add to the local record
1059 self.remove_plugins_from_file(args)
1060
1061 return status_code, uninstall_args
1062
1063 def _get_plugins_from_file(self):
1064 """ get plugins from file

Callers 6

executeMethod · 0.80
test_install_pluginsMethod · 0.80
test_plugins_installMethod · 0.80

Calls 3

pip_commandMethod · 0.80
infoMethod · 0.80

Tested by 5

test_install_pluginsMethod · 0.64
test_plugins_installMethod · 0.64