8000 Fix: `cython` module build failing during CD — Add `cython` build info to `pyproject.toml` by chonknick · Pull Request #180 · chonkie-inc/chonkie · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: cython module build failing during CD — Add cython build info to pyproject.toml #180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

chonknick
Copy link
Contributor

This pull request updates the pyproject.toml file to enhance the build configuration for the chonkie.chunker.c_extensions package. The changes include extending the package data and defining new Cython extension modules.

Build configuration updates:

  • Expanded the package-data for chonkie.chunker.c_extensions to include additional file types (*.c and *.so).
  • Added two new Cython extension modules:
    • chonkie.chunker.c_extensions.split, with source file src/chonkie/chunker/c_extensions/split.pyx.
    • chonkie.chunker.c_extensions.merge, with source file src/chonkie/chunker/c_extensions/merge.pyx.

… C extensions and define new extension modules for split and merge functionalities.
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.

Hello @chonknick, 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!

Summary of Changes

Hello! Gemini here, providing a summary of this pull request. This PR aims to fix an issue where the cython module build was failing during the Continuous Deployment (CD) process. The core change involves updating the pyproject.toml file to correctly configure the build for the chonkie.chunker.c_extensions package. Specifically, it expands the package-data to include compiled .c and .so files alongside the source .pyx and .pxd files, and explicitly defines the split and merge Cython extension modules using the [[tool.setuptools.ext-modules]] section.

Highlights

  • Fixing CD Build Failure: The primary goal of this PR is to resolve a build failure occurring during the CD pipeline related to Cython modules.
  • Update pyproject.toml: The necessary build configuration changes are implemented by modifying the pyproject.toml file.
  • Expand Package Data: The package-data for chonkie.chunker.c_extensions is updated to include compiled .c and .so files, ensuring they are included in the distribution.
  • Define Cython Extensions: Explicit definitions for the chonkie.chunker.c_extensions.split and chonkie.chunker.c_extensions.merge Cython modules are added to the pyproject.toml build configuration.

Changelog

  • pyproject.toml
    • Expanded [tool.setuptools.package-data] for chonkie.chunker.c_extensions to include *.c and *.so files (line 143).
    • Added [[tool.setuptools.ext-modules]] entry for chonkie.chunker.c_extensions.split, specifying its source file src/chonkie/chunker/c_extensions/split.pyx (lines 145-147).
    • Added [[tool.setuptools.ext-modules]] entry for chonkie.chunker.c_extensions.merge, specifying its source file src/chonkie/chunker/c_extensions/merge.pyx (lines 149-151).
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


Builds fail, a common plight,
Cython needs config just right.
Add the files, define the mod,
Now CD passes, praise the cod!

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.

@chonknick chonknick merged commit c619220 into main Jun 4, 2025
5 checks passed
Copy link
Contributor
@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Updates pyproject.toml to fix Cython module build failures during continuous deployment by enhancing build configuration for C extensions.

  • Added *.c and *.so files to package-data for proper distribution of compiled Cython modules
  • Defined new Cython extension modules split and merge in build configuration
  • Updated build system requirements to specify Cython 3.0.0+ as a build dependency

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

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 enhances the build configuration for the chonkie.chunker.c_extensions package by updating the pyproject.toml file. The changes include expanding the package data and defining new Cython extension modules. Overall, the changes seem reasonable and address the issue of failing cython module builds during CD. However, I have a few suggestions to improve the configuration.

Summary of Findings

  • Package Data Explanation: Adding a comment to explain why .c and .so files are included in package-data enhances maintainability.
  • Extension Module Descriptions: Including descriptions or comments above each ext-modules entry improves readability and maintainability.

Merge Readiness

The pull request addresses the failing cython module build during CD by updating the pyproject.toml file. The changes are well-structured and include necessary configurations for the Cython extension modules. While the suggested improvements are minor, incorporating them would enhance the code's readability and maintainability. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. However, I believe that this pull request is in good shape to be merged after addressing the comments.

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
0