feat(uv): parse the dist-manifest.json to not hardcode sha256 in rules_python (#2578)
Finalize the `uv` extension interface employing a builder pattern so
that the users can specify the exact version that needs to be
registered.
This also moves the registration of the actual toolchain to
`rules_python`
itself and ensures that an incompatible noop toolchain is registered if
nothing is configured. This ensures that the
`register_toolchains("@uv//:all")`
never fails.
If the `url/sha256` values are not specified, this is falling back to
using the `dist-manifest.json` on the GH releases page so that
we can get the expected `sha256` value of each available file and
download all of the usable archives. This means that `rules_python` no
longer needs to be updated for `uv` version bumps.
The remaining bits for closing the ticket:
- [ ] Finalize the `lock` interface.
- [ ] Add the locking target to the `pip.parse` hub repo if
`pyproject.toml`
is passed in.
- [ ] Add a rule/target for `venv` creation.
Work towards #1975.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.