You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs: document how to configure MODULE.bazel for different use cases (#1864)
This largely comes from being regularly tagged on BCR PRs about how a
module should be configured. This info was sort of already in the
getting started docs, but that isn't an obvious place to go and bloated
the what should be simplified steps to getting started.
After registration, your Python targets will use the toolchain's interpreter during execution, but a system-installed interpreter
161
-
is still used to 'bootstrap' Python targets (see https://github.com/bazelbuild/rules_python/issues/691).
162
-
You may also find some quirks while using this toolchain. Please refer to [python-build-standalone documentation's _Quirks_ section](https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html).
163
-
164
-
## Toolchain usage in other rules
165
-
166
-
Python toolchains can be utilized in other bazel rules, such as `genrule()`, by adding the `toolchains=["@rules_python//python:current_py_toolchain"]` attribute. You can obtain the path to the Python interpreter using the `$(PYTHON2)` and `$(PYTHON3)`["Make" Variables](https://bazel.build/reference/be/make-variables). See the
167
-
{gh-path}`test_current_py_toolchain <tests/load_from_macro/BUILD.bazel>` target for an example.
168
-
169
80
## "Hello World"
170
81
171
-
Once you've imported the rule set into your `WORKSPACE` using any of these
172
-
methods, you can then load the core rules in your `BUILD` files with the following:
82
+
Once you've imported the rule set using either Bzlmod or WORKSPACE, you can then
83
+
load the core rules in your `BUILD` files with the following:
0 commit comments