From 7eb497777db12968b3313933f3faee74cac99d4f Mon Sep 17 00:00:00 2001 From: Stefan Penner Date: Wed, 21 May 2025 16:00:02 -0600 Subject: [PATCH] fix: Warn only when all SHAs fail to match a requirement --- python/private/pypi/parse_requirements.bzl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/private/pypi/parse_requirements.bzl b/python/private/pypi/parse_requirements.bzl index bdfac46ed6..e696e605d6 100644 --- a/python/private/pypi/parse_requirements.bzl +++ b/python/private/pypi/parse_requirements.bzl @@ -334,8 +334,8 @@ def _add_dists(*, requirement, index_urls, logger = None): sdist = maybe_sdist continue - if logger: - logger.warn(lambda: "Could not find a whl or an sdist with sha256={}".format(sha256)) + if logger and (len(whls) == 0 and sdist == None): + logger.warn(lambda: "Could not find a whl or an sdist with sha256={} for requirement={}".format(sha256, requirement)) yanked = {} for dist in whls + [sdist]: