Skip to content

docs: document current_py_cc_headers and related toolchain targets#3602

Open
Saish-3 wants to merge 2 commits intobazel-contrib:mainfrom
Saish-3:doc-current-cc-headers
Open

docs: document current_py_cc_headers and related toolchain targets#3602
Saish-3 wants to merge 2 commits intobazel-contrib:mainfrom
Saish-3:doc-current-cc-headers

Conversation

@Saish-3
Copy link

@Saish-3 Saish-3 commented Feb 16, 2026

Adds documentation explaining:

  • current_py_cc_headers
  • current_py_cc_headers_abi3
  • current_py_cc_libs

Describes how these targets expose headers and libraries
from the active Python C toolchain and clarifies that they
should be used instead of legacy alias targets when embedding
Python or building C extensions.

This addresses issue #3098.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Saish-3, 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 enhances the rules_python documentation by introducing a new section that explains the purpose and usage of current_py_cc_headers, current_py_cc_headers_abi3, and current_py_cc_libs. These targets are crucial for correctly consuming Python C headers and libraries from the active Python C toolchain, especially when embedding Python or developing C extensions, thereby improving compatibility and clarity for users.

Highlights

  • Documentation of current_py_cc_headers: Added documentation for @rules_python//python/cc:current_py_cc_headers, explaining its role in exposing Python C toolchain headers.
  • Documentation of current_py_cc_headers_abi3: Added documentation for @rules_python//python/cc:current_py_cc_headers_abi3, detailing its function in providing ABI3-compatible Python C toolchain headers.
  • Documentation of current_py_cc_libs: Added documentation for @rules_python//python/cc:current_py_cc_libs, clarifying its use for exposing Python C toolchain libraries.
  • Usage guidance for Python C toolchain targets: Provided guidance on using these new targets instead of legacy aliases for embedding Python or building C extensions, ensuring compatibility.
  • Toolchain registration requirements: Explained the necessity of registering a Python C toolchain for these targets to function, noting automatic registration under bzlmod and explicit registration for non-bzlmod setups.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/toolchains.md
    • Added a new section titled "Consuming Python C headers and libraries" to document the current_py_cc_headers, current_py_cc_headers_abi3, and current_py_cc_libs targets.
    • Explained the behavior of these targets as cc_library-like entities forwarding providers from the underlying toolchain.
    • Included instructions on toolchain registration requirements for these targets.
    • Provided guidance on using these targets over legacy aliases for C extensions and Python embedding.
Activity
  • No activity has occurred on this pull request since its creation.
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 valuable documentation for current_py_cc_headers and related targets, explaining their purpose and usage. The new section is clear and well-written. I've provided a few minor suggestions to improve formatting consistency with the rest of the document by wrapping target names and keywords in backticks.

Comment on lines +863 to +864
Under bzlmod, a toolchain is registered automatically. In non-bzlmod
setups, users must ensure that a toolchain is explicitly registered.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For consistency with the rest of the document, please wrap bzlmod and non-bzlmod in backticks to format them as code.

Suggested change
Under bzlmod, a toolchain is registered automatically. In non-bzlmod
setups, users must ensure that a toolchain is explicitly registered.
Under `bzlmod`, a toolchain is registered automatically. In `non-bzlmod`
setups, users must ensure that a toolchain is explicitly registered.

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.

1 participant