Skip to content

Commit b9d4002

Browse files
committed
update documentation
1 parent 35adf5c commit b9d4002

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

python/private/pypi/whl_library.bzl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,9 @@ whl_library_attrs = dict({
577577
The dep template to use for referencing the dependencies. It should have `{name}`
578578
and `{target}` tokens that will be replaced with the normalized distribution name
579579
and the target that we need respectively.
580+
581+
For example if your whl depends on `numpy` and your Python package repo is named
582+
`pip` so that you would normally do `@pip//numpy`, then this should be: `@pip//{name}`.
580583
""",
581584
),
582585
"filename": attr.string(
@@ -615,11 +618,21 @@ attr makes `extra_pip_args` and `download_only` ignored.""",
615618
doc = "The whl file that should be used instead of downloading or building the whl.",
616619
),
617620
"whl_patches": attr.label_keyed_string_dict(
618-
doc = """a label-keyed-string dict that has
619-
json.encode(struct([whl_file], patch_strip]) as values. This
620-
is to maintain flexibility and correct bzlmod extension interface
621-
until we have a better way to define whl_library and move whl
622-
patching to a separate place. INTERNAL USE ONLY.""",
621+
doc = """
622+
A label-keyed-string dict that has json.encode(struct([whls], patch_strip]) as values.
623+
So it will look something like this:
624+
```
625+
"//path/to/package:my.patch": json.encode(struct(
626+
whls = ["something-2.7.1-py3-none-any.whl"],
627+
patch_strip = 1,
628+
)),
629+
```
630+
The patch is applied within the scope of the .whl file.
631+
I.e. you should create the patch from the same place you unziped the wheel.
632+
633+
634+
This is to maintain flexibility and correct bzlmod extension interface until we have a better
635+
way to define whl_library and move whl patching to a separate place. INTERNAL USE ONLY.""",
623636
),
624637
"_python_path_entries": attr.label_list(
625638
# Get the root directory of these rules and keep them as a default attribute

0 commit comments

Comments
 (0)