refactor(pypi): move absolute_url to whl_library (#3652) With this PR we move the processing of the `index_url` to the `whl_library` as a preparatory step for easier `facts` implementation. The motivation is many-fold: 1. Do not have too much duplication in the facts file by potentially naturally eliminating the `index_url` prefix from the `whls` if it appears like so on the index contents. 2. Avoid doing `envsubst` too early and have logic that has to deal with it. 3. Make the cache just return fact values from the lock file in the future instead of needing to change to an absolute URL and do envsubst on it. 4. We should have a better performance because we should be doing way fewer calls to make the URL absolute during parsing of the index. 5. With the `index_url` passed to the `whl_library`, we can help out the `purl` construction as what has been discussed in #3531 about wheels from non-public indexes. Summary: - Attempt to put the `index_url` in the fewest structs possible. - Extract the `urllib` utilities file for manipulation of the URLs. - Simplify tests testing the `absolute_url` logic. Work towards #2731
This repository is the home of the core Python rules -- py_library, py_binary, py_test, 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.