Skip to content

Commit 7234dda

Browse files
authored
docs: Improve bazel-runfiles docs (#2824)
1 parent 070aa43 commit 7234dda

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/runfiles/README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ with open(r.Rlocation("my_workspace/path/to/my/data.txt"), "r") as f:
5959
# ...
6060
```
6161

62+
Here `my_workspace` is the name you specified via `module(name = "...")` in your `MODULE.bazel` file (with `--enable_bzlmod`, default as of Bazel 7) or `workspace(name = "...")` in `WORKSPACE` (with `--noenable_bzlmod`).
63+
6264
The code above creates a manifest- or directory-based implementation based on the environment variables in `os.environ`. See `Runfiles.Create()` for more info.
6365

6466
If you want to explicitly create a manifest- or directory-based
@@ -70,9 +72,7 @@ r1 = Runfiles.CreateManifestBased("path/to/foo.runfiles_manifest")
7072
r2 = Runfiles.CreateDirectoryBased("path/to/foo.runfiles/")
7173
```
7274

73-
If you want to start subprocesses, and the subprocess can't automatically
74-
find the correct runfiles directory, you can explicitly set the right
75-
environment variables for them:
75+
If you want to start subprocesses that access runfiles, you have to set the right environment variables for them:
7676

7777
```python
7878
import subprocess

0 commit comments

Comments
 (0)