Skip to content

Conversation

@aignas
Copy link
Collaborator

@aignas aignas commented Jan 27, 2026

Before we would try to get the whl path and extract to the sibling
directory. Whilst this is not failing right now, technically this is not
the best behaviour because the whl itself may come from elsewhere. This
PR is simplifying code to see if it helps solve an issue on Windows.

Fixes #3543

Before we would try to get the whl path and extract to the sibling
directory. Whilst this is not failing right now, technically this is not
the best behaviour because the whl itself may come from elsewhere. This
PR is simplifying code to see if it helps solve an issue on Windows.

Fixes bazel-contrib#3543
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @aignas, 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 refines the Python wheel extraction mechanism to enhance robustness and resolve platform-specific issues, particularly on Windows. By simplifying the target installation path calculation, the change ensures that wheel contents are consistently extracted to the intended site-packages directory within the repository context, thereby mitigating previous extraction failures.

Highlights

  • Simplified Wheel Extraction Logic: The logic for determining the installation directory for Python wheels has been simplified. Previously, it attempted to derive a sibling directory based on the wheel's path, which could lead to issues. Now, it directly uses rctx.path("site-packages") to extract contents into a site-packages directory relative to the current repository context.
  • Windows Compatibility Fix: This change specifically addresses and aims to fix an issue with wheel extraction on Windows, particularly when bazelrc contains XX flags, which was tracked in issue When using rules_python 1.8.x with rules_mypy on Windows (Bazel 8.x), whl_library extraction fails #3543.
  • Changelog Update: A new entry for version 1.8.3 has been added to CHANGELOG.md, documenting the fix for wheel extraction on Windows.

🧠 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.

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

The pull request simplifies the wheel extraction process by extracting contents directly to the repository's root site-packages directory. This change addresses potential issues with whl_path originating from various locations, particularly on Windows. However, this modification introduces an inconsistency in how the root directory for merging data files is determined, which could lead to incorrect file placement.

@aignas aignas mentioned this pull request Jan 27, 2026
@aignas aignas enabled auto-merge January 27, 2026 07:18
@aignas aignas added this pull request to the merge queue Jan 27, 2026
Merged via the queue into bazel-contrib:main with commit abe2699 Jan 27, 2026
4 checks passed
@aignas aignas deleted the aignas.fix.pipstar-extract-windows branch January 27, 2026 15:20
aignas added a commit that referenced this pull request Jan 28, 2026
Before we would try to get the whl path and extract to the sibling
directory. Whilst this is not failing right now, technically this is not
the best behaviour because the whl itself may come from elsewhere. This
PR is simplifying code to see if it helps solve an issue on Windows.

Fixes #3543

(cherry picked from commit abe2699)
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.

When using rules_python 1.8.x with rules_mypy on Windows (Bazel 8.x), whl_library extraction fails

2 participants