8000 docs: clarify that PyInfo.transitive_sources may not include py files… · maffoo/rules_python@4dc0518 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4dc0518

Browse files
authored
docs: clarify that PyInfo.transitive_sources may not include py files (bazel-contrib#2367)
The docs previously somewhat implied that the `srcs` were always present, which isn't true for e.g. pyc-only builds.
1 parent b6fc2a0 commit 4dc0518

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

python/private/py_info.bzl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,14 @@ to always include these files, as the originating target expects them to exist.
129129
"transitive_sources": """\
130130
:type: depset[File]
131131
132-
A (`postorder`-compatible) depset of `.py` files appearing in the target's
133-
`srcs` and the `srcs` of the target's transitive `deps`.
134-
135-
These are `.py` source files that are considered required and downstream
136-
binaries (or equivalent) must include in their outputs.
132+
A (`postorder`-compatible) depset of `.py` files that are considered required
133+
and downstream binaries (or equivalent) **must** include in their outputs
134+
to have a functioning program.
135+
136+
Normally, these are the `.py` files in the appearing in the target's `srcs` and
137+
the `srcs` of the target's transitive `deps`, **however**, precompile settings
138+
may cause `.py` files to be omitted. In particular, pyc-only builds may result
139+
in this depset being **empty**.
137140
138141
::::{versionchanged} 0.37.0
139142
The files are considered necessary for downstream binaries to function;

0 commit comments

Comments
 (0)
0