@@ -474,7 +474,7 @@ def install_dependency(self, package_name: str) -> bool:
474474 return self ._install_custom (package_name )
475475 return False
476476
477- def is_outdated (self , package_name : str ) -> bool :
477+ def is_outdated (self , package_name : str , installed : bool = False ) -> bool :
478478 """Return whether the a package is outdated. If no such package exist return False too."""
479479 data = self .deps .get_dependency_data (package_name )
480480 if data is None :
@@ -525,6 +525,10 @@ def is_outdated(self, package_name: str) -> bool:
525525 if data .commit != has_hash :
526526 return True
527527
528+ # In some cases we do not want to check if the dependency is installed
529+ if not installed :
530+ return False
531+
528532 # For pip-installable dependencies, also check if the package is accessible
529533 # in the current Python process
530534 if package_name in self .deps .git_deps and data .pip_install :
@@ -538,14 +542,22 @@ def is_outdated(self, package_name: str) -> bool:
538542
539543 return False
540544
541- def get_oudated_dependencies (self ) -> list [str ]:
545+ def get_outdated_dependencies (self ) -> list [str ]:
542546 """Return a list of the names of all outdated packages. For Git dependencies this means
543547 an outdated commit hash, for the others a different URL or target directory.""" # noqa
544- return list (map (str , filter (self .is_outdated , self .deps .get_all_dependencies ())))
548+ return list (
549+ map (
550+ str ,
551+ filter (
552+ lambda pkg : self .is_outdated (pkg , installed = True ),
553+ self .deps .get_all_dependencies (),
554+ ),
555+ )
556+ )
545557
546558 def update (self ) -> None :
547559 """With a live display and multithreading update all dependencies that are outdated."""
548- deps_outdated = self .get_oudated_dependencies ()
560+ deps_outdated = self .get_outdated_dependencies ()
549561
550562 # Function passed to threadpool
551563 def install_wrapper (package_name : str , status : _StatusTracker ) -> bool :
0 commit comments