Skip to content

build: use cibuildwheels for PyPi compatible packages#64

Open
g-husam wants to merge 5 commits intomainfrom
feature/manylinux-pypi
Open

build: use cibuildwheels for PyPi compatible packages#64
g-husam wants to merge 5 commits intomainfrom
feature/manylinux-pypi

Conversation

@g-husam
Copy link
Collaborator

@g-husam g-husam commented Feb 27, 2026

Also use abi3 for producing a wheel that works for Python 3.10+, without having to build different wheels for each Python minor version.

Also use abi3 for producing a wheel that works for Python 3.10+, without having to build different wheels for each Python minor version.
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 significantly enhances the Python package build and distribution process by adopting cibuildwheel for generating PyPI-compatible wheels and enabling abi3 for broader Python version compatibility. These changes streamline the build workflow, reduce the number of required wheel variants, and ensure more robust distribution of the package across different Python environments.

Highlights

  • cibuildwheel Integration: Integrated cibuildwheel into the Cloud Build process to generate PyPI-compatible wheels, streamlining the build and distribution of Python packages.
  • abi3 Support: Enabled abi3 for Python 3.10 and later in pyproject.toml, allowing a single wheel to be compatible across multiple Python minor versions, reducing build complexity.
  • Cloud Build Workflow Refactoring: Refactored the cloudbuild.yaml to separate the source distribution (sdist) build from the wheel build, improving modularity and clarity of the build pipeline.

🧠 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
  • cloudbuild.yaml
    • Modified the 'build' step to specifically create only the source distribution (sdist) and renamed its ID to 'build-sdist'.
    • Introduced a new 'build-wheels' step to handle the generation of manylinux wheels using cibuildwheel.
    • Added commands to install cibuildwheel and docker.io within the 'build-wheels' step.
    • Included a Docker socket volume mount for the 'build-wheels' step to allow cibuildwheel to use Docker.
    • Updated the 'upload-to-ar' step to wait for the 'build-wheels' step instead of the old 'build' step.
    • Adjusted the 'trigger-exit-gate' step number from 3 to 4 due to the insertion of the new wheel build step.
  • pyproject.toml
    • Added wheel.py-api = 'cp310' to enable abi3 for Python 3.10 and later, ensuring forward compatibility for wheels.
    • Introduced a [tool.cibuildwheel] section to configure cibuildwheel.
    • Set cibuildwheel.build = 'cp310-*' to build only for Python 3.10, leveraging abi3.
    • Configured cibuildwheel.skip to exclude 32-bit and musllinux builds.
    • Added [tool.cibuildwheel.linux] specific settings, including environment variables for SKBUILD_CMAKE_ARGS and before-build commands to install necessary build tools.
Activity
  • No human activity has been recorded on this pull request yet.
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 successfully transitions the build process to use cibuildwheel and leverages abi3 for Python 3.10 and later. This is a significant improvement for PyPI package compatibility, reducing the number of wheels needed, and future-proofing the distribution. The pyproject.toml changes correctly configure cibuildwheel and abi3 as intended. There are a couple of minor improvements that can be made in the cloudbuild.yaml for efficiency and reliability.

echo "Detected architecture: $(uname -m)"

echo "Building C++ extensions with editable install (local check)..."
SKBUILD_CMAKE_ARGS="-DBUILD_TESTING=OFF" pip install -e .
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The command SKBUILD_CMAKE_ARGS="-DBUILD_TESTING=OFF" pip install -e . in the build-wheels step appears to be redundant. cibuildwheel creates its own isolated build environment and handles dependencies and build configurations via its before-build hook (which is correctly set up in pyproject.toml). Running this pip install -e . outside of cibuildwheel's controlled environment might lead to an unnecessary build or potential inconsistencies with the wheels produced by cibuildwheel.

cloudbuild.yaml Outdated
- |
# Install cibuildwheel and the docker client
pip install cibuildwheel
apt-get update && apt-get install -y docker.io
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The apt-get update && apt-get install -y docker.io command can sometimes be slow or introduce transient failures due to external repository issues. While necessary for cibuildwheel to use Docker, for improved build reliability and speed, consider using a base image that already has Docker pre-installed, or exploring alternative ways to ensure Docker is available in the build environment if possible.

Also use abi3 for producing a wheel that works for Python 3.10+, without having to build different wheels for each Python minor version.
Also use abi3 for producing a wheel that works for Python 3.10+, without having to build different wheels for each Python minor version.
@g-husam g-husam requested review from Leahlijuan and kkkapu February 28, 2026 18:51
@github-actions
Copy link

Python Code Coverage Summary

Code Coverage

Package Line Rate Branch Rate Health
src.ml_flashpoint 100% 100%
src.ml_flashpoint.adapter 100% 100%
src.ml_flashpoint.adapter.megatron 97% 94%
src.ml_flashpoint.adapter.nemo 98% 94%
src.ml_flashpoint.adapter.pytorch 99% 88%
src.ml_flashpoint.checkpoint_object_manager 92% 91%
src.ml_flashpoint.core 96% 92%
src.ml_flashpoint.replication 81% 81%
Summary 95% (2058 / 2170) 91% (471 / 518)

Minimum allowed line rate is 90%

@github-actions
Copy link

C++ Code Coverage Summary

Code Coverage

Package Line Rate Branch Rate Health
src.ml_flashpoint.checkpoint_object_manager.buffer_object 93% 54%
src.ml_flashpoint.checkpoint_object_manager.object_manager 70% 37%
src.ml_flashpoint.replication.transfer_service 78% 40%
Summary 81% (910 / 1126) 43% (683 / 1604)

Minimum allowed line rate is 80%

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