# maturin

> Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages

- **URL**: https://www.freshcrate.ai/projects/maturin
- **Author**: pypi
- **Category**: Developer Tools
- **Latest version**: `v1.13.3` (2026-05-11)
- **License**: Unknown
- **Source**: https://github.com/pyo3/maturin
- **Language**: Rust
- **GitHub**: 5,560 stars, 394 forks
- **Registry**: pypi (`maturin`)
- **Tags**: `pypi`

## Description

# Maturin

_formerly pyo3-pack_

[![Maturin User Guide](https://img.shields.io/badge/user-guide-brightgreen?logo=readthedocs&style=flat-square)](https://maturin.rs)
[![Crates.io](https://img.shields.io/crates/v/maturin.svg?logo=rust&style=flat-square)](https://crates.io/crates/maturin)
[![PyPI](https://img.shields.io/pypi/v/maturin.svg?logo=python&style=flat-square)](https://pypi.org/project/maturin)
[![discord server](https://img.shields.io/discord/1209263839632424990?logo=discord&style=flat-square)](https://discord.gg/33kcChzH7f)

Build and publish crates with [pyo3, cffi and uniffi bindings](https://maturin.rs/bindings) as well as rust binaries as python packages with minimal configuration.
It supports building wheels for python 3.8+ on Windows, Linux, macOS and FreeBSD, can upload them to [pypi](https://pypi.org/) and has basic PyPy and GraalPy support.

Check out the [User Guide](https://maturin.rs/)!

## Usage

You can either download binaries from the [latest release](https://github.com/PyO3/maturin/releases/latest) or install it with [pipx](https://pypa.github.io/pipx/) or [uv](https://github.com/astral-sh/uv):

```shell
# pipx
pipx install maturin
# uv
uv tool install maturin
```

> [!NOTE]
>
> `pip install maturin` should also work if you don't want to use pipx.

There are three main commands:

- `maturin new` creates a new cargo project with maturin configured.
- `maturin build` builds the wheels and stores them in a folder (`target/wheels` by default), but doesn't upload them. It's recommended to publish packages with [uv](https://github.com/astral-sh/uv) using `uv publish`.
- `maturin develop` builds the crate and installs it as a python module directly in the current virtualenv. Note that while `maturin develop` is faster, it doesn't support all the feature that running `pip install` after `maturin build` supports.

maturin doesn't need extra configuration files and doesn't clash with an existing setuptools-rust configuration.
You can even integrate it with testing tools such as [tox](https://tox.readthedocs.io/en/latest/).
There are examples for the different bindings in the `test-crates` folder.

The name of the package will be the name of the cargo project, i.e. the name field in the `[package]` section of `Cargo.toml`.
The name of the module, which you are using when importing, will be the `name` value in the `[lib]` section (which defaults to the name of the package). For binaries, it's simply the name of the binary generated by cargo.

When using `maturin build` and `maturin develop` commands, you can compile a performance-optimized program by adding the `-r` or `--release` flag.

## Python packaging basics

Python packages come in two formats:
A built form called wheel and source distributions (sdist), both of which are archives.
A wheel can be compatible with any python version, interpreter (cpython and pypy, mainly), operating system and hardware architecture (for pure python wheels),
can be limited to a specific platform and architecture (e.g. when using ctypes or cffi) or to a specific python interpreter and version on a specific architecture and operating system (e.g. with pyo3).

When using `pip install` on a package, pip tries to find a matching wheel and install that. If it doesn't find one, it downloads the source distribution and builds a wheel for the current platform,
which requires the right compilers to be installed. Installing a wheel is much faster than installing a source distribution as building wheels is generally slow.

When you publish a package to be installable with `pip install`, you upload it to [pypi](https://pypi.org/), the official package repository.
For testing, you can use [test pypi](https://test.pypi.org/) instead, which you can use with `pip install --index-url https://test.pypi.org/simple/`.
Note that for [publishing for linux](#manylinux-and-auditwheel), you need to use the manylinux docker container or zig, while for publishing from your repository you can use the [PyO3/maturin-action](https://github.com/PyO3/maturin-action) github action.

## Mixed rust/python projects

To create a mixed rust/python project, create a folder with your module name (i.e. `lib.name` in Cargo.toml) next to your Cargo.toml and add your python sources there:

```
my-project
├── Cargo.toml
├── my_project
│   ├── __init__.py
│   └── bar.py
├── pyproject.toml
├── README.md
└── src
    └── lib.rs
```

You can specify a different python source directory in `pyproject.toml` by setting `tool.maturin.python-source`, for example

**pyproject.toml**

```toml
[tool.maturin]
python-source = "python"
module-name = "my_project._lib_name"
```

then the project structure would look like this:

```
my-project
├── Cargo.toml
├── python
│   └── my_project
│       ├── __init__.py
│       └── bar.py
├── pyproject.toml
├── README.md
└── src
    └── lib.rs
```

> [!NOTE]
>
> This structure is recommended to avoid [a common `ImportError` pitfall](https://github.com/PyO3/maturin/issues/490)

matur

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `v1.13.3` | 2026-05-11 | High | ## What's Changed * fix: disable abi3 in pyo3 config for version-specific fallback builds by @trim21 in https://github.com/PyO3/maturin/pull/3180  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.2...v1.13.3 |
| `v1.13.2` | 2026-05-10 | High | ## What's Changed * fix: resolve test failures in distro packaging environments by @messense in https://github.com/PyO3/maturin/pull/3129 * fix: redirect tracing output to stderr to avoid breaking PEP 517 by @chrisburr in https://github.com/PyO3/maturin/pull/3131 * fix: skip interpreters with empty output for WSL2 cross-compile by @plusls in https://github.com/PyO3/maturin/pull/3137 * fix: set explicit lib_name in pyo3 config for Android abi3 cross-compilation by @messense in https://github. |
| `1.13.1` | 2026-04-21 | Low | Imported from PyPI (1.13.1) |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |
| `v1.13.1` | 2026-04-09 | Medium | ## What's Changed * fix: fall back to placeholder for abi3 when found interpreters are too old by @messense in https://github.com/PyO3/maturin/pull/3126  See also v1.13.0 release highlight: https://github.com/PyO3/maturin/releases/tag/v1.13.0  **Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.0...v1.13.1 |

## Citation

- HTML: https://www.freshcrate.ai/projects/maturin
- Markdown: https://www.freshcrate.ai/projects/maturin.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/maturin/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
