Skip to content

feat(python): add PyO3-based Python bindings#600

Open
4fuu wants to merge 2 commits into
dmtrKovalenko:mainfrom
4fuu:feat/python-bindings
Open

feat(python): add PyO3-based Python bindings#600
4fuu wants to merge 2 commits into
dmtrKovalenko:mainfrom
4fuu:feat/python-bindings

Conversation

@4fuu

@4fuu 4fuu commented Jun 14, 2026

Copy link
Copy Markdown

Summary

This PR adds a new Python binding for FFF using PyO3, providing a native extension with a clean Pythonic API.

Changes

  • New Rust crate crates/fff-python/ with PyO3 bindings
    • FileFinder class exposing search, glob, directory search, mixed search, grep and multi-grep APIs
    • Full result types: FileItem, DirItem, GrepMatch, Score, etc.
    • Lifecycle support via context manager and destroy()
  • Python package packages/fff-python/ using the maturin build backend
    • PyPI package name is fff-python; import name remains fff
    • Updated README, tests and standalone example
  • CI
    • Added .github/workflows/python.yml for Ubuntu/macOS/Windows testing
    • Extended release.yaml to build Python wheels (x86_64/aarch64) and sdist, with optional PyPI publishing via trusted publishing
  • Workspace
    • Added crates/fff-python to workspace members and updated Cargo.lock
    • Updated .gitignore for Python build artifacts

Verification

Tested on the fork repository; the relevant CI checks pass:

  • cargo check -p fff-python
  • cargo clippy -p fff-python --no-deps -- -D warnings
  • uv run pytest -v ✅ (8 passed)
  • uv run python examples/basic.py .
  • Python CI passes on Ubuntu, macOS and Windows
  • Prebuild Python wheel jobs build successfully across all target platforms

4fuu added 2 commits June 14, 2026 19:02
- Add native PyO3 extension in crates/fff-python
- Replace ctypes wrapper with maturin-built package in packages/fff-python
- Expose FileFinder, search/glob/directory/mixed/grep APIs and result types
- Use PyPI package name fff-python (import name remains fff)
- Update workspace Cargo.toml/Cargo.lock and .gitignore for Python artifacts
- Add .github/workflows/python.yml to test bindings on Ubuntu/macOS/Windows
- Extend release.yaml with Python wheel builds (x86_64/aarch64) and sdist
- Add optional PyPI publish job using trusted publishing
@4fuu 4fuu changed the title feat(python): migrate Python bindings from ctypes to PyO3 feat(python): add PyO3-based Python bindings Jun 14, 2026
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