fix(pypi): show overridden index urls in pypi download error (#3130)
Closes #2985
Suppose invalid `experimental_index_url_overrides` in `pip.parse` is set
like below.
```bzl
pip.parse(
experimental_index_url = "https://pypi.org/simple",
experimental_index_url_overrides = {"mypy": "https://invalid.com"},
hub_name = "pypi",
requirements_lock = "//:requirements_lock.txt",
)
```
It fails as follows, showing only "pypi.org" as pypi index url, not
"invalid.com" for for `mypy` package.
```
Error in fail: Failed to download metadata for ["mypy"] for from urls: ["https://pypi.org/simple"].
If you would like to skip downloading metadata for these packages please add 'simpleapi_skip=["mypy"]' to your 'pip.parse' call.
```
To show overridden url for each package, show url of each package that
has been failed to download metadata. The error message with this PR is
like below.
```
Error in fail:
Failed to download metadata of the following packages from urls:
{
"mypy": "https://invalid.com",
}
If you would like to skip downloading metadata for these packages please add 'simpleapi_skip=["mypy"]' to your 'pip.parse' call.
```This repository is the home of the core Python rules -- py_library, py_binary, py_test, py_proto_library, and related symbols that provide the basis for Python support in Bazel. It also contains package installation rules for integrating with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.