Maturin is a build tool that compiles Rust crates into Python wheel packages, supporting multiple binding systems such as PyO3, CFFI, and UniFFI to create native extension modules. It manages the full build pipeline from Rust compilation to wheel assembly, including cross-compilation for different operating systems and architectures without requiring native hardware.
The tool integrates development-mode installation with automatic rebuilds: when a Python import hook detects source changes, it triggers recompilation before the module loads. Editable installs link the compiled module into site-packages so Python edits take effect instantly. For supply chain compliance, maturin generates and embeds a software bill of materials from the Rust dependency graph and external libraries into the wheel metadata.
Beyond building, maturin offers project scaffolding for hybrid Rust/Python projects, CI workflow generation for automated publishing, and type stub generation for static type checking. It can also distribute CLI binaries bundled with the wheel and bundle arbitrary data files. Publishing to PyPI is supported, including with OpenID Connect authentication for tokenless releases.
Maturin is available as a command-line tool that can be installed via pip or cargo and integrates with existing Rust and Python development workflows.