setuptoolsrust
Setuptools-rust is a Python packaging tool that enables building Rust extensions within setuptools-based projects. It provides a RustExtension class to describe a Python extension implemented in Rust and a RustBuildExt command that coordinates building the Rust code as part of the Python package build. The extension expects a Rust crate located at a specified path (typically a directory containing Cargo.toml) and produces a compiled shared library that Python can import as a module. The build backend is usually maturin when available, with a fallback to cargo if maturin is not installed. This arrangement allows developers to create Python packages that include performance-critical Rust components and distribute them as wheels or source distributions for multiple platforms.
Setuptools-rust targets crates that use bindings such as PyO3 or rust-cpython, but it can be used with
Usage typically involves declaring the Rust extension in setup.py via ext_modules and RustExtension, for example by
Setuptools-rust is maintained to support the Python Rust ecosystem, aiming to simplify packaging of Rust-based Python