Skip to content

Commit 35e213b

Browse files
committed
feat: add guidelines for Rust-Python integration to ensure consistency in class implementations
1 parent a22b28a commit 35e213b

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/copilot-instructions.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,14 @@ def process_data(data: List[str], max_length: Optional[int] = None) -> List[str]
100100

101101
return result
102102
```
103+
104+
## Rust-Python Integration
105+
106+
**Important:** Some classes in this repository have their core implementations in Rust with Python bindings. For any changes related to these classes in Python:
107+
108+
1. **Always update the Rust implementation first** before making corresponding changes to the Python bindings
109+
2. Ensure the Rust changes are properly tested in Rust before updating Python code
110+
3. Update Python bindings to reflect the new Rust API
111+
4. Add or update Python tests to cover the new functionality
112+
113+
This ensures consistency between the Rust core and Python interface, and prevents binding mismatches.

GEMINI.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ The repository is organized as follows:
3131
- `pyproject.toml`: Defines the Python project metadata and dependencies.
3232
- `Cargo.toml`: Defines the Rust project metadata and dependencies.
3333

34+
## Important Development Note
35+
36+
Some classes in this repository have their core implementations in Rust.
37+
For any changes related to these classes in Python, ensure the corresponding updates are first made in the Rust implementation.
38+
3439
## How to Build and Test
3540

3641
### Development Setup

0 commit comments

Comments
 (0)