Skip to content

Commit

Permalink
feat(pypi): only query SimpleAPI for pkgs that have shas (#2527)
Browse files Browse the repository at this point in the history
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 #2100
  • Loading branch information
aignas authored Dec 27, 2024
1 parent 922929b commit a632044
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ Unreleased changes template.
* Bazel 6 support is dropped and Bazel 7.4.1 is the minimum supported
version, per our Bazel support matrix. Earlier versions are not
tested by CI, so functionality cannot be guaranteed.
* ({bzl:obj}`pip.parse`) Only query SimpleAPI for packages that have
sha values in the `requirements.txt` file.

{#v0-0-0-fixed}
### Fixed
Expand Down
1 change: 1 addition & 0 deletions python/private/pypi/parse_requirements.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def parse_requirements(
req.distribution: None
for reqs in requirements_by_platform.values()
for req in reqs.values()
if req.srcs.shas
}),
)

Expand Down
2 changes: 1 addition & 1 deletion tests/pypi/extension/extension_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ some_pkg==0.0.1
index_url = "pypi.org",
index_url_overrides = {},
netrc = None,
sources = ["simple", "some_pkg"],
sources = ["simple"],
),
"cache": {},
"parallel_download": False,
Expand Down

0 comments on commit a632044

Please sign in to comment.