Skip to content

Commit

Permalink
doc: clarify the precompile attribute affects the local target (#2179)
Browse files Browse the repository at this point in the history
Also mention the pyc_collection attribute and precompiling guide to
better guide users on how to use precompiling and use binary-level
opt-in.
  • Loading branch information
rickeylev authored Sep 5, 2024
1 parent 076fbc7 commit fe1d9a7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions python/private/common/attributes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ attribute.
),
"precompile": attr.string(
doc = """
Whether py source files should be precompiled.
See also: {flag}`--precompile` flag, which can override this attribute in some cases.
Whether py source files **for this target** should be precompiled.
Values:
Expand All @@ -291,6 +289,15 @@ Values:
* `disabled`: Don't compile Python source files at build time.
* `if_generated_source`: Compile Python source files, but only if they're a
generated file.
:::{seealso}
* The {flag}`--precompile` flag, which can override this attribute in some cases
and will affect all targets when building.
* The {obj}`pyc_collection` attribute for transitively enabling precompiling on
a per-target basis.
* The [Precompiling](precompiling) docs for a guide about using precompiling.
:::
""",
default = PrecompileAttr.INHERIT,
values = sorted(PrecompileAttr.__members__.values()),
Expand Down

0 comments on commit fe1d9a7

Please sign in to comment.