diff --git a/python/pip_install/extract_wheels/lib/annotation.py b/python/pip_install/extract_wheels/lib/annotation.py index 977668e66b..48aaa8026a 100644 --- a/python/pip_install/extract_wheels/lib/annotation.py +++ b/python/pip_install/extract_wheels/lib/annotation.py @@ -81,7 +81,10 @@ def collect(self, requirements: List[str]) -> Dict[str, Annotation]: if pkg in unused: collection.update({pkg: unused.pop(pkg)}) - logging.warning("Unused annotations: {}".format(sorted(list(unused.keys())))) + if unused: + logging.warning( + "Unused annotations: {}".format(sorted(list(unused.keys()))) + ) return collection