Skip to content

Commit 7a63133

Browse files
committed
feat(pypi): only query SimpleAPI for pkgs that have shas
Later in the code we would only use the results of SimpleAPI if the package has shas, so actually doing these calls is just wasting time, because we would be dropping the results anyway. Work towards bazel-contrib#2100
1 parent b5729b4 commit 7a63133

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ Unreleased changes template.
5656
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
5757
version, per our Bazel support matrix. Earlier versions are not
5858
tested by CI, so functionality cannot be guaranteed.
59+
* ({bzl:obj}`pip.parse`) Only query SimpleAPI for packages that have
60+
sha values in the `requirements.txt` file.
5961

6062
{#v0-0-0-fixed}
6163
### Fixed

python/private/pypi/parse_requirements.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def parse_requirements(
184184
req.distribution: None
185185
for reqs in requirements_by_platform.values()
186186
for req in reqs.values()
187+
if req.srcs.shas
187188
}),
188189
)
189190

tests/pypi/extension/extension_tests.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ some_pkg==0.0.1
575575
index_url = "pypi.org",
576576
index_url_overrides = {},
577577
netrc = None,
578-
sources = ["simple", "some_pkg"],
578+
sources = ["simple"],
579579
),
580580
"cache": {},
581581
"parallel_download": False,

0 commit comments

Comments
 (0)