Skip to content

Commit e2e9a43

Browse files
authored
docs: fix some more bad xrefs (#2910)
Misc updates to fix doc warnings * Replace `collection` with `list`. Collections aren't a formal type. Just use list as a stand-in. * Create faux AttributeBuilder typedef so that AttributeBuilder references don't give a xref warning. * Change to object-lookup for `python` name (its a module extension, not rule)
1 parent acc8f82 commit e2e9a43

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

python/private/python_register_toolchains.bzl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def python_register_toolchains(
4848
4949
With `bzlmod` enabled, this function is not needed since `rules_python` is
5050
handling everything. In order to override the default behaviour from the
51-
root module one can see the docs for the {rule}`python` extension.
51+
root module one can see the docs for the {obj}`python` extension.
5252
5353
- Create a repository for each built-in platform like "python_3_8_linux_amd64" -
5454
this repository is lazily fetched when Python is needed for that platform.
@@ -71,9 +71,10 @@ def python_register_toolchains(
7171
tool_versions: {type}`dict` contains a mapping of version with SHASUM
7272
and platform info. If not supplied, the defaults in
7373
python/versions.bzl will be used.
74-
platforms: {type}`dict[str, platform_info]` platforms to create toolchain
75-
repositories for. Note that only a subset is created, depending
76-
on what's available in `tool_versions`.
74+
platforms: {type}`dict[str, struct]` platforms to create toolchain
75+
repositories for. Keys are platform names, and values are platform_info
76+
structs. Note that only a subset is created, depending on what's
77+
available in `tool_versions`.
7778
minor_mapping: {type}`dict[str, str]` contains a mapping from `X.Y` to `X.Y.Z`
7879
version.
7980
**kwargs: passed to each {obj}`python_repository` call.

python/private/rule_builders.bzl

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ ExecGroup = struct(
192192
)
193193

194194
def _ToolchainType_typedef():
195-
"""Builder for {obj}`config_common.toolchain_type()`
195+
"""Builder for {obj}`config_common.toolchain_type`
196196
197197
:::{include} /_includes/field_kwargs_doc.md
198198
:::
@@ -393,7 +393,7 @@ def _RuleCfg_update_inputs(self, *others):
393393
394394
Args:
395395
self: implicitly added
396-
*others: {type}`collection[Label]` collection of labels to add to
396+
*others: {type}`list[Label]` collection of labels to add to
397397
inputs. Only values not already present are added. Note that a
398398
`Label`, not `str`, should be passed to ensure different apparent
399399
labels can be properly de-duplicated.
@@ -405,7 +405,7 @@ def _RuleCfg_update_outputs(self, *others):
405405
406406
Args:
407407
self: implicitly added
408-
*others: {type}`collection[Label]` collection of labels to add to
408+
*others: {type}`list[Label]` collection of labels to add to
409409
outputs. Only values not already present are added. Note that a
410410
`Label`, not `str`, should be passed to ensure different apparent
411411
labels can be properly de-duplicated.
@@ -680,6 +680,18 @@ def _AttrsDict_build(self):
680680
attrs[k] = v.build() if _is_builder(v) else v
681681
return attrs
682682

683+
def _AttributeBuilder_typedef():
684+
"""An abstract base typedef for builder for a Bazel {obj}`Attribute`
685+
686+
Instances of this are a builder for a particular `Attribute` type,
687+
e.g. `attr.label`, `attr.string`, etc.
688+
"""
689+
690+
# buildifier: disable=name-conventions
691+
AttributeBuilder = struct(
692+
TYPEDEF = _AttributeBuilder_typedef,
693+
)
694+
683695
# buildifier: disable=name-conventions
684696
AttrsDict = struct(
685697
TYPEDEF = _AttrsDict_typedef,

python/uv/private/uv.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ uv.configure(
122122
"urls": attr.string_list(
123123
doc = """\
124124
The urls to download the binary from. If this is used, {attr}`base_url` and
125-
{attr}`manifest_name` are ignored for the given version.
125+
{attr}`manifest_filename` are ignored for the given version.
126126
127127
::::note
128128
If the `urls` are specified, they need to be specified for all of the platforms

0 commit comments

Comments
 (0)