返回 Skill 列表
extension
分类: 开发与工程无需 API Key

ffi-pyo3-maturin

使用PyO3+maturin构建或修改Rust↔Python FFI。用于绑定构建、冒烟测试和边界验证工作流程。

person作者: jakexiaohubgithub

PyO3 + maturin FFI Workflow

Build

  • cd packages/python_viterbo && uv run maturin develop --manifest-path ../rust_viterbo/Cargo.toml

Test

  • cd packages/python_viterbo && uv run pytest -q tests/smoke

Contract and expectations

  • See: packages/rust_viterbo/docs/ffi-contract.md
  • Keep wrappers thin and convert types near the boundary.
  • Validate inputs at the boundary, return structured errors.
  • Avoid breaking Python-facing APIs without coordination.