Python and Rust compilation, packages, bindings
January 24, 2024
Build Rust Python extensions:
- https://github.com/PyO3/maturin
- https://github.com/PyO3/setuptools-rust and https://github.com/PyO3/pyo3
Python packaging and distribution tool:
Examples:
-
https://github.com/Lucky-Mano/Poetry_C_Extension_Example/blob/master/pyproject.toml
-
creating a native python extension module in rust (
setuptools-rust
to build rust extensions,PyO3
for rust bindings,src/lib.rs
andcargo.toml
for library metadata) - link -
taken from Pydantic which is getting an upgrade, the core module being re-written in rust with ~17x speedup