Maturin

Build and publish Rust crates with PyO3, cffi, and uniffi bindings as Python wheels

Tool
PyPI
v1.14.1
5,760stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
90/100Excellent
Development Activity96
Maintenance100
Community64
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
87/100Excellent
Architecture89
Code Quality90
Innovation88
Learning Curve80

Maturin (formerly pyo3-pack) is a build tool for packaging Rust code as Python extension modules. It builds and publishes crates that use PyO3, cffi, or uniffi bindings, as well as plain Rust binaries, as Python wheels with minimal configuration.

It produces wheels for Python 3.8+ on Windows, Linux, macOS, and FreeBSD, supports cross-compilation and manylinux targets, and can upload the results to PyPI. Simple commands like maturin new, maturin build, and maturin develop cover project scaffolding, wheel building, and installing directly into a virtualenv.

What You Get

  • A maturin CLI with new, build, develop, publish, and sdist commands
  • Wheel building for PyO3, cffi, and uniffi bindings plus plain Rust binaries
  • Cross-compilation and manylinux/musllinux support for portable Linux wheels
  • Direct installation into the active virtualenv via maturin develop
  • Zero extra config files, driven by Cargo.toml and pyproject.toml

Common Use Cases

  • Packaging a PyO3 Rust extension as a pip-installable wheel
  • Building portable manylinux wheels in CI for many Python versions
  • Iterating locally on a Rust extension with maturin develop
  • Publishing native Python packages to PyPI from a Rust crate

Under The Hood

Architecture - Maturin parses Cargo.toml and pyproject.toml (cargo_toml.rs, build_options.rs), detects the binding type via a bridge/binding_generator layer, then a build_context and build_orchestrator drive cargo to compile the crate and assemble a wheel, with an auditwheel module handling manylinux/musllinux platform tags and repair. The CLI subcommands (new, build, develop, publish) sit on top of this pipeline.

Tech Stack - Written in Rust and distributed both as a crate on crates.io and as a Python package (with a thin setup.py/pyproject.toml wrapper) built by maturin itself; it shells out to cargo and integrates with PyO3, cffi, and uniffi bindings, and ships a JSON schema (maturin.schema.json) for its config.

Code Quality - The repo is highly disciplined: an extensive tests/ suite plus test-crates and test-data fixtures, clippy and deny (deny.toml) configuration, a git-cliff changelog config, Dockerfiles for reproducible builds, and nox automation (noxfile.py), reflecting a mature, well-tested project.

API Design - The command surface is small and memorable (new to scaffold, build to produce wheels, develop for local installs, publish to upload), works with zero extra config in common cases, and coexists with setuptools-rust and tools like uv and tox, giving Rust authors a low-friction path to PyPI.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search