Skip to content

Conversation

@e-nomem
Copy link
Contributor

@e-nomem e-nomem commented Nov 28, 2025

No description provided.

@messense messense requested a review from Copilot November 28, 2025 07:58
Copilot finished reviewing on behalf of messense November 28, 2025 07:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the cffi binding generation to use the new BindingGenerator trait pattern, aligning it with the existing PyO3 implementation. This creates a more consistent and maintainable architecture for handling different binding types.

Key Changes:

  • Migrated write_cffi_module function to CffiBindingGenerator struct implementing BindingGenerator trait
  • Updated build_context.rs to use generate_binding with the new generator instead of calling write_cffi_module directly
  • Added .write(true) option to file creation in generate_binding for clarity

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/build_context.rs Updated to instantiate CffiBindingGenerator and use the unified generate_binding function
src/binding_generator/mod.rs Exported CffiBindingGenerator instead of write_cffi_module function, improved file creation options
src/binding_generator/cffi_binding.rs Refactored into trait-based CffiBindingGenerator struct implementing BindingGenerator

@messense messense merged commit bede32c into PyO3:main Nov 28, 2025
51 checks passed
@e-nomem e-nomem deleted the cffi-generator branch November 28, 2025 16: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