Skip to content

Conversation

rickeylev
Copy link
Collaborator

The core PyPI docs and API reference docs have the basics for setting up a multi-platform
Bazel build, but there's a lot of cross-referencing and reading between the lines necessary.

Create a how to guide specifically on how to do it to better explain the nuances.

@rickeylev rickeylev requested a review from aignas as a code owner September 24, 2025 04:53
Copy link
Contributor

Summary of Changes

Hello @rickeylev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a crucial new documentation guide aimed at simplifying the management of multi-platform PyPI dependencies within a Bazel build environment using rules_python and bzlmod. The guide provides a clear, step-by-step approach to configuring diverse Python environments, including variations in Python version, threading models, operating systems, CPU architectures, and hardware accelerators. By offering detailed explanations and a complete working example, it significantly reduces the complexity and guesswork previously associated with setting up such intricate build configurations.

Highlights

  • New How-to Guide: A new documentation guide has been added to explain how to manage complex multi-platform PyPI dependencies using rules_python with bzlmod, addressing the current need for extensive cross-referencing in existing docs.
  • Mapping Requirements to Bazel Configs: The guide details the process of mapping requirements files to Bazel configuration settings, including defining custom platforms with pip.default and associating requirements files using pip.parse.requirements_by_platform.
  • Custom and Predefined Settings: It covers how to define custom build settings (e.g., for CUDA versions) using string_flag and config_setting, and how to leverage predefined rules_python and @platforms settings for OS, CPU, and threading models.
  • Complete Example Provided: A comprehensive example is included, demonstrating the configuration for four different Python 3.14 Linux variations (regular, freethreaded, CUDA 12.9, and ARM/Musl) within BUILD.bazel and MODULE.bazel files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a new how-to guide for managing multi-platform PyPI dependencies. The guide is well-structured and provides a good example. I've found a few typos and a broken command in a code snippet. Addressing these will improve the clarity and correctness of the documentation.

rickeylev and others added 3 commits September 23, 2025 22:00
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@rickeylev rickeylev enabled auto-merge September 24, 2025 05:05
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please link to this from pip.parse docs and from the existing pypi documentation so that users have a better chance to discover this.

@rickeylev rickeylev added this pull request to the merge queue Sep 25, 2025
@aignas aignas removed this pull request from the merge queue due to a manual request Sep 25, 2025
@rickeylev rickeylev requested a review from groodt as a code owner September 26, 2025 23:16
@rickeylev rickeylev removed the request for review from groodt September 26, 2025 23:17
@rickeylev
Copy link
Collaborator Author

LGTM, but please link to this from pip.parse docs and from the existing pypi documentation so that users have a better chance to discover this.

Done

@rickeylev rickeylev enabled auto-merge September 26, 2025 23:17
@rickeylev rickeylev added this pull request to the merge queue Sep 26, 2025
github-merge-queue bot pushed a commit that referenced this pull request Sep 26, 2025
)

The core PyPI docs and API reference docs have the basics for setting up
a multi-platform
Bazel build, but there's a lot of cross-referencing and reading between
the lines necessary.

Create a how to guide specifically on how to do it to better explain the
nuances.

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Merged via the queue into bazel-contrib:main with commit c566258 Sep 26, 2025
4 checks passed
@rickeylev rickeylev deleted the docs.multi.pip.example branch September 26, 2025 23:37
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