Skip to content

Commit 8f8c5b9

Browse files
docs: fix various typos and improve grammar (#3015)
Used Jules to do some copy editing. It found a variety of typos. * Consistently use backticks for rules_python, WORKSPACE, and some other terms * Various simple typo and grammar fixes --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
1 parent 6fd4c0b commit 8f8c5b9

21 files changed

+263
-257
lines changed

docs/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# rules_python Sphinx docs generation
22

33
The docs for rules_python are generated using a combination of Sphinx, Bazel,
4-
and Readthedocs.org. The Markdown files in source control are unlikely to render
4+
and Read the Docs. The Markdown files in source control are unlikely to render
55
properly without the Sphinx processing step because they rely on Sphinx and
66
MyST-specific Markdown functionality.
77

88
The actual sources that Sphinx consumes are in this directory, with Stardoc
9-
generating additional sources or Sphinx.
9+
generating additional sources for Sphinx.
1010

11-
Manually building the docs isn't necessary -- readthedocs.org will
11+
Manually building the docs isn't necessary -- Read the Docs will
1212
automatically build and deploy them when commits are pushed to the repo.
1313

1414
## Generating docs for development
@@ -31,8 +31,8 @@ equivalent bazel command if desired.
3131
### Installing ibazel
3232

3333
The `ibazel` tool can be used to automatically rebuild the docs as you
34-
development them. See the [ibazel docs](https://github.com/bazelbuild/bazel-watcher) for
35-
how to install it. The quick start for linux is:
34+
develop them. See the [ibazel docs](https://github.com/bazelbuild/bazel-watcher) for
35+
how to install it. The quick start for Linux is:
3636

3737
```
3838
sudo apt install npm
@@ -57,9 +57,9 @@ docs/.
5757
The Sphinx configuration is `docs/conf.py`. See
5858
https://www.sphinx-doc.org/ for details about the configuration file.
5959

60-
## Readthedocs configuration
60+
## Read the Docs configuration
6161

62-
There's two basic parts to the readthedocs configuration:
62+
There's two basic parts to the Read the Docs configuration:
6363

6464
* `.readthedocs.yaml`: This configuration file controls most settings, such as
6565
the OS version used to build, Python version, dependencies, what Bazel
@@ -69,4 +69,4 @@ There's two basic parts to the readthedocs configuration:
6969
controls additional settings such as permissions, what versions are
7070
published, when to publish changes, etc.
7171

72-
For more readthedocs configuration details, see docs.readthedocs.io.
72+
For more Read the Docs configuration details, see docs.readthedocs.io.

docs/_includes/py_console_script_binary.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
This rule is to make it easier to generate `console_script` entry points
22
as per Python [specification].
33

4-
Generate a `py_binary` target for a particular console_script `entry_point`
5-
from a PyPI package, e.g. for creating an executable `pylint` target use:
4+
Generate a `py_binary` target for a particular `console_script` entry_point
5+
from a PyPI package, e.g. for creating an executable `pylint` target, use:
66
```starlark
77
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
88

@@ -12,11 +12,12 @@ py_console_script_binary(
1212
)
1313
```
1414

15-
#### Specifying extra dependencies
15+
#### Specifying extra dependencies
1616
You can also specify extra dependencies and the
17-
exact script name you want to call. It is useful for tools like `flake8`, `pylint`,
18-
`pytest`, which have plugin discovery methods and discover dependencies from the
19-
PyPI packages available in the `PYTHONPATH`.
17+
exact script name you want to call. This is useful for tools like `flake8`,
18+
`pylint`, and `pytest`, which have plugin discovery methods and discover
19+
dependencies from the PyPI packages available in the `PYTHONPATH`.
20+
2021
```starlark
2122
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")
2223

@@ -44,13 +45,13 @@ load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_cons
4445
py_console_script_binary(
4546
name = "yamllint",
4647
pkg = "@pip//yamllint",
47-
python_version = "3.9"
48+
python_version = "3.9",
4849
)
4950
```
5051

5152
#### Adding a Shebang Line
5253

53-
You can specify a shebang line for the generated binary, useful for Unix-like
54+
You can specify a shebang line for the generated binary. This is useful for Unix-like
5455
systems where the shebang line determines which interpreter is used to execute
5556
the script, per [PEP441]:
5657

@@ -70,12 +71,12 @@ Python interpreter is available in the environment.
7071

7172
#### Using a specific Python Version directly from a Toolchain
7273
:::{deprecated} 1.1.0
73-
The toolchain specific `py_binary` and `py_test` symbols are aliases to the regular rules.
74-
i.e. Deprecated `load("@python_versions//3.11:defs.bzl", "py_binary")` and `load("@python_versions//3.11:defs.bzl", "py_test")`
74+
The toolchain-specific `py_binary` and `py_test` symbols are aliases to the regular rules.
75+
For example, `load("@python_versions//3.11:defs.bzl", "py_binary")` and `load("@python_versions//3.11:defs.bzl", "py_test")` are deprecated.
7576

76-
You should instead specify the desired python version with `python_version`; see above example.
77+
You should instead specify the desired Python version with `python_version`; see the example above.
7778
:::
78-
Alternatively, the [`py_console_script_binary.binary_rule`] arg can be passed
79+
Alternatively, the {obj}`py_console_script_binary.binary_rule` arg can be passed
7980
the version-bound `py_binary` symbol, or any other `py_binary`-compatible rule
8081
of your choosing:
8182
```starlark

docs/coverage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ when configuring toolchains.
99
## Enabling `rules_python` coverage support
1010

1111
Enabling the coverage support bundled with `rules_python` just requires setting an
12-
argument when registerting toolchains.
12+
argument when registering toolchains.
1313

1414
For Bzlmod:
1515

@@ -32,7 +32,7 @@ python_register_toolchains(
3232
This will implicitly add the version of `coverage` bundled with
3333
`rules_python` to the dependencies of `py_test` rules when `bazel coverage` is
3434
run. If a target already transitively depends on a different version of
35-
`coverage`, then behavior is undefined -- it is undefined which version comes
35+
`coverage`, then the behavior is undefined -- it is undefined which version comes
3636
first in the import path. If you find yourself in this situation, then you'll
3737
need to manually configure coverage (see below).
3838
:::

docs/devguide.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Dev Guide
22

3-
This document covers tips and guidance for working on the rules_python code
4-
base. A primary audience for it is first time contributors.
3+
This document covers tips and guidance for working on the `rules_python` code
4+
base. Its primary audience is first-time contributors.
55

66
## Running tests
77

@@ -12,8 +12,8 @@ bazel test //...
1212
```
1313

1414
And it will run all the tests it can find. The first time you do this, it will
15-
probably take long time because various dependencies will need to be downloaded
16-
and setup. Subsequent runs will be faster, but there are many tests, and some of
15+
probably take a long time because various dependencies will need to be downloaded
16+
and set up. Subsequent runs will be faster, but there are many tests, and some of
1717
them are slow. If you're working on a particular area of code, you can run just
1818
the tests in those directories instead, which can speed up your edit-run cycle.
1919

@@ -22,14 +22,14 @@ the tests in those directories instead, which can speed up your edit-run cycle.
2222
Most code should have tests of some sort. This helps us have confidence that
2323
refactors didn't break anything and that releases won't have regressions.
2424

25-
We don't require 100% test coverage, testing certain Bazel functionality is
25+
We don't require 100% test coverage; testing certain Bazel functionality is
2626
difficult, and some edge cases are simply too hard to test or not worth the
2727
extra complexity. We try to judiciously decide when not having tests is a good
2828
idea.
2929

3030
Tests go under `tests/`. They are loosely organized into directories for the
3131
particular subsystem or functionality they are testing. If an existing directory
32-
doesn't seem like a good match for the functionality being testing, then it's
32+
doesn't seem like a good match for the functionality being tested, then it's
3333
fine to create a new directory.
3434

3535
Re-usable test helpers and support code go in `tests/support`. Tests don't need
@@ -72,9 +72,9 @@ the rule. To have it support setting a new flag:
7272

7373
An integration test is one that runs a separate Bazel instance inside the test.
7474
These tests are discouraged unless absolutely necessary because they are slow,
75-
require much memory and CPU, and are generally harder to debug. Integration
76-
tests are reserved for things that simple can't be tested otherwise, or for
77-
simple high level verification tests.
75+
require a lot of memory and CPU, and are generally harder to debug. Integration
76+
tests are reserved for things that simply can't be tested otherwise, or for
77+
simple high-level verification tests.
7878

7979
Integration tests live in `tests/integration`. When possible, add to an existing
8080
integration test.
@@ -98,9 +98,9 @@ integration test.
9898

9999
## Updating tool dependencies
100100

101-
It's suggested to routinely update the tool versions within our repo - some of the
102-
tools are using requirement files compiled by `uv` and others use other means. In order
103-
to have everything self-documented, we have a special target -
104-
`//private:requirements.update`, which uses `rules_multirun` to run in sequence all
105-
of the requirement updating scripts in one go. This can be done once per release as
101+
It's suggested to routinely update the tool versions within our repo. Some of the
102+
tools are using requirement files compiled by `uv`, and others use other means. In order
103+
to have everything self-documented, we have a special target,
104+
`//private:requirements.update`, which uses `rules_multirun` to run all
105+
of the requirement-updating scripts in sequence in one go. This can be done once per release as
106106
we prepare for releases.

docs/environment-variables.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
This variable allows for additional arguments to be provided to the Python interpreter
66
at bootstrap time when the `bash` bootstrap is used. If
77
`RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS` were provided as `-Xaaa`, then the command
8-
would be;
8+
would be:
99

1010
```
1111
python -Xaaa /path/to/file.py
1212
```
1313

1414
This feature is likely to be useful for the integration of debuggers. For example,
15-
it would be possible to configure the `RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS` to
16-
be set to `/path/to/debugger.py --port 12344 --file` resulting
17-
in the command executed being;
15+
it would be possible to configure `RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS` to
16+
be set to `/path/to/debugger.py --port 12344 --file`, resulting
17+
in the command executed being:
1818

1919
```
2020
python /path/to/debugger.py --port 12345 --file /path/to/file.py
@@ -42,14 +42,14 @@ doing. This is mostly useful for development to debug errors.
4242

4343
:::{envvar} RULES_PYTHON_DEPRECATION_WARNINGS
4444

45-
When `1`, the rules_python will warn users about deprecated functionality that will
45+
When `1`, `rules_python` will warn users about deprecated functionality that will
4646
be removed in a subsequent major `rules_python` version. Defaults to `0` if unset.
4747
:::
4848

4949
::::{envvar} RULES_PYTHON_ENABLE_PYSTAR
5050

51-
When `1`, the rules_python Starlark implementation of the core rules is used
52-
instead of the Bazel-builtin rules. Note this requires Bazel 7+. Defaults
51+
When `1`, the `rules_python` Starlark implementation of the core rules is used
52+
instead of the Bazel-builtin rules. Note that this requires Bazel 7+. Defaults
5353
to `1`.
5454

5555
:::{versionadded} 0.26.0
@@ -62,7 +62,7 @@ The default became `1` if unspecified
6262

6363
::::{envvar} RULES_PYTHON_ENABLE_PIPSTAR
6464

65-
When `1`, the rules_python Starlark implementation of the pypi/pip integration is used
65+
When `1`, the `rules_python` Starlark implementation of the PyPI/pip integration is used
6666
instead of the legacy Python scripts.
6767

6868
:::{versionadded} 1.5.0
@@ -95,8 +95,8 @@ exit.
9595

9696
:::{envvar} RULES_PYTHON_GAZELLE_VERBOSE
9797

98-
When `1`, debug information from gazelle is printed to stderr.
99-
:::
98+
When `1`, debug information from Gazelle is printed to stderr.
99+
::::
100100

101101
:::{envvar} RULES_PYTHON_PIP_ISOLATED
102102

@@ -125,9 +125,9 @@ Determines the verbosity of logging output for repo rules. Valid values:
125125

126126
:::{envvar} RULES_PYTHON_REPO_TOOLCHAIN_VERSION_OS_ARCH
127127

128-
Determines the python interpreter platform to be used for a particular
128+
Determines the Python interpreter platform to be used for a particular
129129
interpreter `(version, os, arch)` triple to be used in repository rules.
130-
Replace the `VERSION_OS_ARCH` part with actual values when using, e.g.
130+
Replace the `VERSION_OS_ARCH` part with actual values when using, e.g.,
131131
`3_13_0_linux_x86_64`. The version values must have `_` instead of `.` and the
132132
os, arch values are the same as the ones mentioned in the
133133
`//python:versions.bzl` file.

docs/extending.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ wrappers around the keyword arguments eventually passed to the `rule()`
4141
function. These builder APIs give access to the _entire_ rule definition and
4242
allow arbitrary modifications.
4343

44-
This is level of control is powerful, but also volatile. A rule definition
44+
This level of control is powerful but also volatile. A rule definition
4545
contains many details that _must_ change as the implementation changes. What
4646
is more or less likely to change isn't known in advance, but some general
47-
rules are:
47+
rules of thumb are:
4848

4949
* Additive behavior to public attributes will be less prone to breaking.
5050
* Internal attributes that directly support a public attribute are likely
@@ -55,7 +55,7 @@ rules are:
5555

5656
## Example: validating a source file
5757

58-
In this example, we derive from `py_library` a custom rule that verifies source
58+
In this example, we derive a custom rule from `py_library` that verifies source
5959
code contains the word "snakes". It does this by:
6060

6161
* Adding an implicit dependency on a checker program
@@ -111,7 +111,7 @@ has_snakes_library = create_has_snakes_rule()
111111

112112
## Example: adding transitions
113113

114-
In this example, we derive from `py_binary` to force building for a particular
114+
In this example, we derive a custom rule from `py_binary` to force building for a particular
115115
platform. We do this by:
116116

117117
* Adding an additional output to the rule's cfg
@@ -136,8 +136,8 @@ def create_rule():
136136
r.cfg.add_output("//command_line_option:platforms")
137137
return r.build()
138138

139-
py_linux_binary = create_linux_binary_rule()
139+
py_linux_binary = create_rule()
140140
```
141141

142-
Users can then use `py_linux_binary` the same as a regular py_binary. It will
142+
Users can then use `py_linux_binary` the same as a regular `py_binary`. It will
143143
act as if `--platforms=//my/platforms:linux` was specified when building it.

docs/gazelle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[Gazelle](https://github.com/bazelbuild/bazel-gazelle)
44
is a build file generator for Bazel projects. It can create new `BUILD.bazel` files for a project that follows language conventions and update existing build files to include new sources, dependencies, and options.
55

6-
Bazel may run Gazelle using the Gazelle rule, or it may be installed and run as a command line tool.
6+
Bazel may run Gazelle using the Gazelle rule, or Gazelle may be installed and run as a command line tool.
77

8-
See the documentation for Gazelle with rules_python in the {gh-path}`gazelle`
8+
See the documentation for Gazelle with `rules_python` in the {gh-path}`gazelle`
99
directory.

docs/getting-started.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Getting started
22

3-
This doc is a simplified guide to help get started quickly. It provides
3+
This document is a simplified guide to help you get started quickly. It provides
44
a simplified introduction to having a working Python program for both `bzlmod`
55
and the older way of using `WORKSPACE`.
66

77
It assumes you have a `requirements.txt` file with your PyPI dependencies.
88

9-
For more details information about configuring `rules_python`, see:
9+
For more detailed information about configuring `rules_python`, see:
1010
* [Configuring the runtime](configuring-toolchains)
11-
* [Configuring third party dependencies (pip/pypi)](./pypi/index)
11+
* [Configuring third-party dependencies (pip/PyPI)](./pypi/index)
1212
* [API docs](api/index)
1313

1414
## Including dependencies
@@ -32,7 +32,7 @@ use_repo(pip, "pypi")
3232

3333
### Using a WORKSPACE file
3434

35-
Using WORKSPACE is deprecated, but still supported, and a bit more involved than
35+
Using `WORKSPACE` is deprecated but still supported, and it's a bit more involved than
3636
using Bzlmod. Here is a simplified setup to download the prebuilt runtimes.
3737

3838
```starlark
@@ -72,7 +72,7 @@ pip_parse(
7272

7373
## "Hello World"
7474

75-
Once you've imported the rule set using either Bzlmod or WORKSPACE, you can then
75+
Once you've imported the rule set using either Bzlmod or `WORKSPACE`, you can then
7676
load the core rules in your `BUILD` files with the following:
7777

7878
```starlark

docs/glossary.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
common attributes
66
: Every rule has a set of common attributes. See Bazel's
77
[Common attributes](https://bazel.build/reference/be/common-definitions#common-attributes)
8-
for a complete listing
8+
for a complete listing.
99

1010
in-build runtime
1111
: An in-build runtime is one where the Python runtime, and all its files, are
@@ -21,9 +21,9 @@ which can be a significant number of files.
2121

2222
platform runtime
2323
: A platform runtime is a Python runtime that is assumed to be installed on the
24-
system where a Python binary runs, whereever that may be. For example, using `/usr/bin/python3`
24+
system where a Python binary runs, wherever that may be. For example, using `/usr/bin/python3`
2525
as the interpreter is a platform runtime -- it assumes that, wherever the binary
26-
runs (your local machine, a remote worker, within a container, etc), that path
26+
runs (your local machine, a remote worker, within a container, etc.), that path
2727
is available. Such runtimes are _not_ part of a binary's runfiles.
2828

2929
The main advantage of platform runtimes is they are lightweight insofar as
@@ -42,8 +42,8 @@ rule callable
4242
accepted; refer to the respective API accepting this type.
4343

4444
simple label
45-
: A `str` or `Label` object but not a _direct_ `select` object. These usually
46-
mean a string manipulation is occuring, which can't be done on `select`
45+
A `str` or `Label` object but not a _direct_ `select` object. This usually
46+
means a string manipulation is occurring, which can't be done on `select`
4747
objects. Such attributes are usually still configurable if an alias is used,
4848
and a reference to the alias is passed instead.
4949

0 commit comments

Comments
 (0)