You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(pypi): select the lowest available libc version by default (bazel-contrib#3255)
The bazel-contrib#3058 PR has subtly changed the default behaviour of
`experimental_index_url` code path and I think in order to make things
easier by default for our users we should go back to that behaviour.
And in addition to this we are starting to make use of the Minimal
Version Selection algorithm for the platforms. This in general allows
users to configure the upper platform version for a particular wheel.
This meant that we had to change the semantics of the API a little:
1. Use MVS for each platform platform tag.
2. Make it such that earlier entries are overridden by later ones, i.e.
`["musllinux_*_x86_64", "musllinux_1_2_x86_64"]` is effectively the
same as just `["musllinux_1_2_x86_64"]`.
A remaining thing that will be left as a followup for bazel-contrib#2747 will be to
figure out how to allow users to ignore certain platform tags.
Fixesbazel-contrib#3250
---------
Co-authored-by: Richard Levasseur <richardlev@gmail.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: python/private/pypi/extension.bzl
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -492,35 +492,37 @@ preference.
492
492
Will always include `"any"` even if it is not specified.
493
493
494
494
The items in this list can contain a single `*` character that is equivalent to matching the
495
-
latest available version component in the platform_tag. Note, if the wheel platform tag does not
496
-
have a version component, e.g. `linux_x86_64` or `win_amd64`, then `*` will act as a regular
497
-
character.
498
-
499
-
We will always select the highest available `platform_tag` version that is compatible with the
500
-
target platform.
495
+
lowest available version component in the platform_tag. If the wheel platform tag does not
496
+
have a version component, e.g. `linux_x86_64` or `win_amd64`, then `*` will act as a regular character.
501
497
502
498
:::{note}
499
+
Normally, the `*` in the matcher means that we will target the lowest platform version that we can
500
+
and will give preference to whls built targeting the older versions of the platform. If you
501
+
specify the version, then we will use the MVS (Minimal Version Selection) algorithm to select the
502
+
compatible wheel. As such, you need to keep in mind how to configure the target platforms to
503
+
select a particular wheel of your preference.
504
+
503
505
We select a single wheel and the last match will take precedence, if the platform_tag that we
504
506
match has a version component (e.g. `android_x_arch`, then the version `x` will be used in the
505
-
matching algorithm).
506
-
507
-
If the matcher you provide has `*`, then we will match a wheel with the highest available target platform, i.e. if `musllinux_1_1_arch` and `musllinux_1_2_arch` are both present, then we will select `musllinux_1_2_arch`.
508
-
Otherwise we will select the highest available version that is equal or lower to the specifier, i.e. if `manylinux_2_12` and `manylinux_2_17` wheels are present and the matcher is `manylinux_2_15`, then we will match `manylinux_2_12` but not `manylinux_2_17`.
509
-
:::
510
-
511
-
:::{note}
512
-
The following tag prefixes should be used instead of the legacy equivalents:
513
-
* `manylinux_2_5` instead of `manylinux1`
514
-
* `manylinux_2_12` instead of `manylinux2010`
515
-
* `manylinux_2_17` instead of `manylinux2014`
516
-
517
-
When parsing the whl filenames `rules_python` will automatically transform wheel filenames to the
518
-
latest format.
507
+
MVS matching algorithm).
508
+
509
+
Common patterns:
510
+
* To select any versioned wheel for an `<os>`, `<arch>`, use `<os>_*_<arch>`, e.g.
511
+
`manylinux_2_17_x86_64`.
512
+
* To exclude versions up to `X.Y` - **submit a PR supporting this feature**.
513
+
* To exclude versions above `X.Y`, provide the full platform tag specifier, e.g.
514
+
`musllinux_1_2_x86_64`, which will ensure that no wheels with `musllinux_1_3_x86_64` or higher
515
+
are selected.
519
516
:::
520
517
521
518
:::{seealso}
522
519
See official [docs](https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-tag) for more information.
523
520
:::
521
+
:::{versionchanged} VERSION_NEXT_FEATURE
522
+
The matching of versioned platforms have been switched to MVS (Minimal Version Selection)
523
+
algorithm for easier evaluation logic and fewer surprises. The legacy platform tags are
524
+
supported from this version without extra handling from the user.
0 commit comments