Skip to content

Commit a0b7f43

Browse files
committed
fix defaults and add docs
1 parent 95a8423 commit a0b7f43

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

MODULE.bazel

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ pip = use_extension("//python/extensions:pip.bzl", "pip")
7575
os_name = "linux",
7676
platform = "linux_{}".format(cpu),
7777
whl_abi_tags = [
78-
"cp{major}{minor}",
79-
"abi3",
8078
"none",
79+
"abi3",
80+
"cp{major}{minor}",
8181
],
8282
whl_platform_tags = [
8383
"linux_*_{}".format(cpu),
@@ -103,9 +103,9 @@ pip = use_extension("//python/extensions:pip.bzl", "pip")
103103
os_name = "osx",
104104
platform = "osx_{}".format(cpu),
105105
whl_abi_tags = [
106-
"cp{major}{minor}",
107-
"abi3",
108106
"none",
107+
"abi3",
108+
"cp{major}{minor}",
109109
],
110110
whl_platform_tags = [
111111
"macosx_*_{}".format(suffix)
@@ -135,9 +135,9 @@ pip = use_extension("//python/extensions:pip.bzl", "pip")
135135
os_name = "windows",
136136
platform = "windows_{}".format(cpu),
137137
whl_abi_tags = [
138-
"cp{major}{minor}",
139-
"abi3",
140138
"none",
139+
"abi3",
140+
"cp{major}{minor}",
141141
],
142142
whl_platform_tags = whl_platform_tags,
143143
)

python/private/pypi/extension.bzl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,9 +447,10 @@ def _configure(config, *, platform, os_name, arch_name, config_settings, env = {
447447
arch_name = arch_name,
448448
config_settings = config_settings,
449449
whl_abi_tags = whl_abi_tags or [
450-
"cp{major}{minor}",
451-
"abi3",
450+
# NOTE @aignas 2025-07-08: the least preferred is the first item in the list
452451
"none",
452+
"abi3",
453+
"cp{major}{minor}",
453454
],
454455
whl_platform_tags = whl_platform_tags,
455456
env = {
@@ -884,21 +885,32 @@ If you are defining custom platforms in your project and don't want things to cl
884885
"whl_abi_tags": attr.string_list(
885886
doc = """\
886887
A list of ABIs to select wheels for. The values can be either strings or include template
887-
parameters like `{0}` which will be replaced with python version parts. e.g. `cp{0}{1}` will
888-
result in `cp313` given the full python version is `3.13.5`.
888+
parameters like `{major}` and `{minor}` which will be replaced with python version parts. e.g.
889+
`cp{major}{minor}` will result in `cp313` given the full python version is `3.13.5`.
890+
891+
:::{note}
892+
We select a single wheel and the last match will take precedence.
893+
:::
889894
895+
:::{seealso}
890896
See official [docs](https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#abi-tag) for more information.
897+
:::
891898
""",
892899
),
893900
"whl_platform_tags": attr.string_list(
894901
doc = """\
895902
A list of `platform_tag` matchers so that we can select the best wheel based on the user
896-
preference. Per platform we will select a single wheel and the last match from this list will
897-
take precedence.
903+
preference.
898904
899905
The items in this list can contain a single `*` character that is equivalent to `.*` regex match.
900906
907+
:::{note}
908+
We select a single wheel and the last match will take precedence.
909+
:::
910+
911+
:::{seealso}
901912
See official [docs](https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-tag) for more information.
913+
:::
902914
""",
903915
),
904916
}

0 commit comments

Comments
 (0)