commit | 43583d1fe84bc2b4daa1531e3dcf404dbcb98dda | [log] [tgz] |
---|---|---|
author | Richard Levasseur <rlevasseur@google.com> | Thu Oct 10 20:12:55 2024 -0700 |
committer | GitHub <noreply@github.com> | Fri Oct 11 03:12:55 2024 +0000 |
tree | 0e34571d394682586dac7801b1cf67185a7380b7 | |
parent | 1388a89dc04374ed33c761e17b7747b85211c063 [diff] |
fix(bzlmod): let workspace-invoked python_register_toolchains to register toolchains (#2289) While migrating to bzlmod, users may have a hybrid build where WORKSPACE contains python_register_toolchain() calls. Because these calls originate from WORKSPACE files, the `native.register_toolchain` APIs are still available. At the same time, we still detect that bzlmod is enabled, and thus disable calling those functions. The net effect is, users aren't able to register toolchains in such a hybrid setup. At the same time, because the code path is shared, we can't have the bzlmod toolchain code try to call them, as it'll fail. To accomodate both cases, have the bzlmod toolchain code pass a special arg so that `python_register_toolchains` knows to skip parts that don't apply to the bzlmod toolchain invocation. This was all unwound by some users and pointed out in a Slack thread. A few people are manually carrying an equivalent patch for a working hybrid mode. Fixes https://github.com/bazelbuild/rules_python/issues/1675
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.