Skip to content

feat(pypi): define default pip platforms for all toolchain platforms - #4456

Merged
rickeylev merged 3 commits into
bazel-contrib:mainfrom
aignas:aignas.feat.pip-default-platforms
Nov 13, 2026
Merged

rickeylev merged 3 commits into
bazel-contrib:mainfrom
aignas:aignas.feat.pip-default-platforms

Conversation

@aignas

@aignas aignas commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

The default pip.default platforms only covered the x86_64 and aarch64
Linux, macOS and Windows platforms, so the toolchains for the other platforms
could not use the wheels from a pip hub. Add the default platforms for all of
the platforms that the hermetic Python toolchains support:

  • linux_armv7, linux_i386, linux_ppc, linux_riscv64, linux_s390x
    using the manylinux wheels.
  • linux_x86_64_musl using the musllinux wheels.
  • osx_arm64e and windows_x86_32.

Each of them has a _freethreaded variant. The glibc Linux platforms now also
match on --py_linux_libc, so that they do not overlap with the new musl
platform.

A new test ensures that each of the toolchain platform variants in
//python:versions.bzl has a pip platform with the same constraints and
settings, so that adding a toolchain platform requires adding a pip platform.

The WORKSPACE pip_parse uses the same definitions for selecting the wheels,
so the linux_ppc, linux_riscv64 and linux_s390x platforms there can now
select their platform specific wheels.

Work towards #3902

The default `pip.default` platforms only covered the `x86_64` and `aarch64`
Linux, macOS and Windows platforms, so the toolchains for the other platforms
could not use the wheels from a pip hub. Add the default platforms for all of
the platforms that the hermetic Python toolchains support and a test that
ensures that each toolchain platform variant has a matching pip platform.

The glibc Linux platforms now also match on `--py_linux_libc`, so that they
do not overlap with the new musl platform, which uses the `musllinux` wheels.
@aignas

aignas commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator Author

This PR was drafted by an AI coding agent (Claude Code) working for @aignas as part of the plan in #3902. It stays a draft until @aignas has reviewed it. Review comments will be handled by @aignas, possibly with the help of the agent; any agent-written replies will be marked as such.

Agent-generated comment, posted automatically on behalf of the user.

@aignas
aignas marked this pull request as ready for review November 9, 2026 12:39
@aignas
aignas requested a review from rickeylev as a code owner November 9, 2026 12:39
@rickeylev
rickeylev added this pull request to the merge queue Nov 13, 2026
Merged via the queue into bazel-contrib:main with commit db252ef Nov 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants