Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python/private/pypi/simpleapi_download.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ def _get_dist_urls(ctx, *, default_index, index_urls, index_url_overrides, sourc
parse_index = True,
versions = {pkg: None for pkg in sources},
block = block,
allow_fail = True,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Adding allow_fail = True here will cause existing tests to fail. The mock read_simpleapi functions in tests/pypi/simpleapi_download/simpleapi_download_tests.bzl (specifically in _test_simple and _test_index_overrides) do not accept the allow_fail keyword argument.

You should update those mock signatures to include **kwargs or explicitly accept allow_fail to maintain compatibility with this change.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting a better solution if it exists, and if the fix is not obvious, or simple, I am happy with closing this (tbh low effort) PR. I created this because this worked for our use case.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another fix could be to just not call the index at all if there is only one index url given.

**kwargs
)
if hasattr(download, "wait"):
Expand All @@ -170,6 +171,8 @@ def _get_dist_urls(ctx, *, default_index, index_urls, index_url_overrides, sourc

found_on_index = {}
for index_url, result in results.items():
if not result.success:
continue
for pkg in sources:
if pkg in found_on_index:
# We have already found the package, skip searching for it in
Expand Down