Skip to content

Commit 4761c25

Browse files
authored
docs: document the exec tools toolchain pieces (bazel-contrib#2163)
This makes it easier to know how to manually define `py_exec_tools_toolchain()`. Also doc the `inherit` value for the `pyc_collection` attribute.
1 parent 2a5ba18 commit 4761c25

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

docs/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ sphinx_stardocs(
9090
"//python:py_test_bzl",
9191
"//python/cc:py_cc_toolchain_info_bzl",
9292
"//python/entry_points:py_console_script_binary_bzl",
93+
"//python/private:py_exec_tools_info_bzl",
94+
"//python/private:py_exec_tools_toolchain_bzl",
9395
"//python/private/common:py_binary_rule_bazel_bzl",
9496
"//python/private/common:py_library_rule_bazel_bzl",
9597
"//python/private/common:py_runtime_rule_bzl",

docs/api/rules_python/python/config_settings/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Values:
3030
Determines if Python source files should be compiled at build time.
3131

3232
:::{note}
33-
The flag value is overridden by the target level `precompile` attribute,
33+
The flag value is overridden by the target level {attr}`precompile` attribute,
3434
except for the case of `force_enabled` and `forced_disabled`.
3535
:::
3636

python/private/BUILD.bazel

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,19 @@ bzl_library(
203203
],
204204
)
205205

206+
bzl_library(
207+
name = "py_exec_tools_info_bzl",
208+
srcs = ["py_exec_tools_info.bzl"],
209+
)
210+
206211
bzl_library(
207212
name = "py_exec_tools_toolchain_bzl",
208213
srcs = ["py_exec_tools_toolchain.bzl"],
209214
deps = [
215+
":py_exec_tools_info_bzl",
210216
":toolchain_types_bzl",
211217
"//python/private/common:providers_bzl",
218+
"@bazel_skylib//lib:paths",
212219
"@bazel_skylib//rules:common_settings",
213220
],
214221
)

python/private/common/py_executable.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,9 @@ Determines whether pyc files from dependencies should be manually included.
9999
NOTE: This setting is only useful with {flag}`--precompile_add_to_runfiles=decided_elsewhere`.
100100
101101
Valid values are:
102+
* `inherit`: Inherit the value from {flag}`--pyc_collection`.
102103
* `include_pyc`: Add pyc files from dependencies in the binary (from
103-
`PyInfo.transitive_pyc_files`.
104+
{obj}`PyInfo.transitive_pyc_files`.
104105
* `disabled`: Don't explicitly add pyc files from dependencies. Note that
105106
pyc files may still come from dependencies if a target includes them as
106107
part of their runfiles (such as when {obj}`--precompile_add_to_runfiles=always`

0 commit comments

Comments
 (0)