Check if the plugin is installed, and if the version is valid Args: package: the package name need to be installed Returns: if_installed: True if installed version: the version of installed or None if not installed
(package)
| 780 | |
| 781 | @staticmethod |
| 782 | def check_plugin_installed(package): |
| 783 | """ Check if the plugin is installed, and if the version is valid |
| 784 | |
| 785 | Args: |
| 786 | package: the package name need to be installed |
| 787 | |
| 788 | Returns: |
| 789 | if_installed: True if installed |
| 790 | version: the version of installed or None if not installed |
| 791 | |
| 792 | """ |
| 793 | |
| 794 | if package.split('.')[-1] == 'whl': |
| 795 | # install from whl should test package name instead of module name |
| 796 | _, module_version, package_name = get_modules_from_package(package) |
| 797 | local_installed, version = PluginsManager._check_plugin_installed( |
| 798 | package_name) |
| 799 | if local_installed and module_version != version: |
| 800 | return False, version |
| 801 | elif not local_installed: |
| 802 | return False, version |
| 803 | return True, module_version |
| 804 | else: |
| 805 | return PluginsManager._check_plugin_installed(package) |
| 806 | |
| 807 | @staticmethod |
| 808 | def _check_plugin_installed(package, verified_version=None): |
no test coverage detected