PipxInterface/Pipx.py

changeset 32
b7a3ae7519ba
parent 23
4c18addf12b2
child 49
ec976c5b88ae
--- a/PipxInterface/Pipx.py	Sat Jul 27 19:39:32 2024 +0200
+++ b/PipxInterface/Pipx.py	Sun Jul 28 11:46:18 2024 +0200
@@ -441,8 +441,9 @@
 
         @param package name of the package
         @type str
-        @return latest version in case the package is outdated and None otherwise
-        @rtype str or None
+        @return tuple containing the latest version in case the package is outdated
+            or None otherwise and a flag indicating any outdated dependencies
+        @rtype tuple of (str or None, bool)
         """
         args = ["runpip", package, "list", "--outdated", "--format", "json"]
         if Preferences.getPip("PipSearchIndex"):
@@ -458,15 +459,15 @@
                     "<p>Reason: {1}</p>"
                 ).format(package, output),
             )
-            return None
+            return None, False
 
         outdatedList = json.loads(output)
         # check if the main package is in the list
         for outdatedPackage in outdatedList:
             if outdatedPackage["name"] == package:
-                return outdatedPackage["latest_version"]
+                return outdatedPackage["latest_version"], len(outdatedList) > 1
 
-        return None
+        return None, bool(outdatedList)
 
     def upgradePackage(self, package):
         """

eric ide

mercurial