Skip to content

Commit 1f0765d

Browse files
authored
docs: document some environment variables (#2077)
This is so they're more discoverable for both developers and users.
1 parent bf70429 commit 1f0765d

File tree

3 files changed

+53
-7
lines changed

3 files changed

+53
-7
lines changed

docs/sphinx/environment-variables.md

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Environment Variables
2+
3+
:::{envvar} RULES_PYTHON_REPO_DEBUG
4+
5+
When `1`, repository rules will print debug information about what they're
6+
doing. This is mostly useful for development to debug errors.
7+
:::
8+
9+
:::{envvar} RULES_PYTHON_REPO_DEBUG_VERBOSITY
10+
11+
Determines the verbosity of logging output for repo rules. Valid values:
12+
13+
* `DEBUG`
14+
* `INFO`
15+
* `TRACE`
16+
:::
17+
18+
:::{envvar} RULES_PYTHON_PIP_ISOLATED
19+
20+
Determines if `--isolated` is used with pip.
21+
22+
Valid values:
23+
* `0` and `false` mean to not use isolated mode
24+
* Other non-empty values mean to use isolated mode.
25+
:::
26+
27+
:::{envvar} RULES_PYTHON_BZLMOD_DEBUG
28+
29+
When `1`, bzlmod extensions will print debug information about what they're
30+
doing. This is mostly useful for development to debug errors.
31+
:::
32+
33+
:::{envvar} RULES_PYTHON_ENABLE_PYSTAR
34+
35+
When `1`, the rules_python Starlark implementation of the core rules is used
36+
instead of the Bazel-builtin rules. Note this requires Bazel 7+.
37+
:::
38+
39+
:::{envvar} RULES_PYTHON_BOOTSTRAP_VERBOSE
40+
41+
When `1`, debug information about bootstrapping of a program is printed to
42+
stderr.
43+
:::
44+
45+
:::{envvar} VERBOSE_COVERAGE
46+
47+
When `1`, debug information about coverage behavior is printed to stderr.
48+
:::

docs/sphinx/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ Contributing <contributing>
6666
support
6767
Changelog <changelog>
6868
api/index
69+
environment-variables
6970
glossary
7071
genindex
7172
```

python/private/pypi/attrs.bzl

+4-7
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ or empty in the environment), if `"VARNAME"` is listed in the
154154
"isolated": attr.bool(
155155
doc = """\
156156
Whether or not to pass the [--isolated](https://pip.pypa.io/en/stable/cli/pip/#cmdoption-isolated) flag to
157-
the underlying pip command. Alternatively, the `RULES_PYTHON_PIP_ISOLATED` environment variable can be used
157+
the underlying pip command. Alternatively, the {envvar}`RULES_PYTHON_PIP_ISOLATED` environment variable can be used
158158
to control this flag.
159159
""",
160160
default = True,
@@ -185,13 +185,10 @@ python_interpreter. An example value: "@python3_x86_64-unknown-linux-gnu//:pytho
185185
doc = """\
186186
If True, suppress printing stdout and stderr output to the terminal.
187187
188-
If you would like to get more diagnostic output, please use:
189-
190-
RULES_PYTHON_REPO_DEBUG=1
191-
188+
If you would like to get more diagnostic output, set
189+
{envvar}`RULES_PYTHON_REPO_DEBUG=1 <RULES_PYTHON_REPO_DEBUG>`
192190
or
193-
194-
RULES_PYTHON_REPO_DEBUG_VERBOSITY=<INFO|DEBUG|TRACE>
191+
{envvar}`RULES_PYTHON_REPO_DEBUG_VERBOSITY=<INFO|DEBUG|TRACE> <RULES_PYTHON_REPO_DEBUG_VERBOSITY>`
195192
""",
196193
),
197194
# 600 is documented as default here: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#execute

0 commit comments

Comments
 (0)