From 70fde760982049815888a1c07c7d2a98d273b842 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Fri, 25 Feb 2022 13:54:12 -0800 Subject: [PATCH] conditionally log unused annotations --- python/pip_install/extract_wheels/lib/annotation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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