| commit | 8f114a5326e8940702e7e701a4cedd22ea4c1403 | [log] [tgz] |
|---|---|---|
| author | Ignas Anikevicius <240938+aignas@users.noreply.github.com> | Wed Jan 31 14:41:20 2024 +0900 |
| committer | GitHub <noreply@github.com> | Wed Jan 31 05:41:20 2024 +0000 |
| tree | f5a2e2a80fd4658bf94693ef3c5578d1e6a80fda | |
| parent | 0ff94b1247f2c45cbe6d065fde85933d38d31e6d [diff] |
feat(toolchain): support specifying x.y versions in transitions (#1720) This is inspired by how rules_go is registering their toolchains. Their toolchains have multiple `target_settings` values. This allows for a simpler passing of `X.Y` version to the `py_binary` and `py_test` rules and does not strictly require us to provide the APIs that pass the full python version value as the closure. This is only possible because #1555 introduced working aliases and now we can also have this. Summary: - refactor: move the toolchain_def to starlark as opposed to templating - refactor: move the version setting as well - feat: support matching on X.Y versions - feat: X.Y.Z will match if X.Y is used as python_version flag and the MINOR_MAPPING has `"X.Y": "X.Y.Z"`. - test: add tests checking the generated config settings. - doc: add an example of how we could use the transition files directly See https://github.com/bazelbuild/rules_go/blob/master/go/private/go_toolchain.bzl#L181 --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com>
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.
Currently, the core rules build into the Bazel binary, and the symbols in this repository are simple aliases. However, we are migrating the rules to Starlark and removing them from the Bazel binary. Therefore, the future-proof way to depend on Python rules is via this repository. SeeMigrating from the Bundled Rules below.
The core rules are stable. Their implementation in Bazel is subject to Bazel's backward compatibility policy. Once migrated to rules_python, they may evolve at a different rate, but this repository will still 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.