PluginMetricsRadon.py

changeset 80
a4f2000c6687
parent 77
7e1793d03381
child 83
d3490ea9facc
--- a/PluginMetricsRadon.py	Sun Apr 25 16:43:43 2021 +0200
+++ b/PluginMetricsRadon.py	Thu May 13 18:10:26 2021 +0200
@@ -27,7 +27,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "3.1.0"
+version = "4.0.0"
 className = "RadonMetricsPlugin"
 packageName = "RadonMetrics"
 shortDescription = "Code metrics plugin using radon package"
@@ -984,5 +984,22 @@
         if self.__projectRawMetricsDialog:
             self.__projectRawMetricsDialog.clear()
 
+
+def installDependencies(pipInstall):
+    """
+    Function to install dependencies of this plug-in.
+    
+    @param pipInstall function to be called with a list of package names.
+    @type function
+    """
+    try:
+        from radon import __version__ as radon_version
+        import Globals
+        if Globals.versionToTuple(radon_version) < (4, 5, 0):
+            # force an upgrade
+            pipInstall(["radon>=4.5.0"])
+    except ImportError:
+        pipInstall(["radon>=4.5.0"])
+
 #
 # eflag: noqa = M801

eric ide

mercurial