setuptools-rust
Setuptools Rust extension plugin
Decision gist · record as of 2026-08-14
Yes, if you are writing Python extensions in Rust. The plugin is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. It is the standard way to package Rust extensions for PyPI distribution. Install it only in your build-system requirements (pyproject.toml), not as a runtime dependency.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Rust toolchain (rustc, cargo) installed on the build system; Python 3.9 or later.
- Low install friction; pure Python wheel with only setuptools and semantic_version as runtime dependencies.
- Actively maintained with recent releases and 677 repository stars.
License · maintenance · safety
permissive license (permissive) — MIT-licensed under permissive terms, allowing use in commercial and private projects without significant restrictions.
last release 2026-06-27 (48 days) · last repo commit 2026-08-12 · 677 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 6,925,523 downloads/mo, #1,809 on PyPI
Alternatives
Verify before relying
# In pyproject.toml:
[build-system]
requires = ["setuptools", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[[tool.setuptools-rust.ext-modules]]
target = "my_module._lib"
binding = "PyO3"
# Then build and install:
python -m pip install -e .- Whether cross-compilation support (crossenv, cross, cargo-zigbuild) is production-ready or experimental.
- Performance overhead or compilation time impact compared to C extensions.
- Whether binary wheel distribution is supported on all major platforms (Linux, macOS, Windows).
What it is and what it does
setuptools-rust bridges the gap between Rust and Python packaging by acting as a setuptools plugin that knows how to compile Rust code into Python extension modules. It handles the build process for extensions written with PyO3 or rust-cpython, letting you distribute them as wheels just like C extensions. The plugin reads configuration from pyproject.toml, invokes the Rust toolchain (cargo), and integrates the compiled binaries into your Python package.
You use it by declaring Rust extension modules in your pyproject.toml, pointing to your Cargo.toml and specifying the binding framework (PyO3 or rust-cpython). It then manages compilation during package installation or wheel building. The plugin supports both library modules (for import) and binary executables, and handles cross-compilation via tools like crossenv or cargo-zigbuild.
Use it for
- Package a performance-critical Python library written in Rust for distribution on PyPI.
- Build a Python extension module that calls Rust code for CPU-intensive tasks.
- Distribute a Rust binary tool alongside Python code as a single wheel.
- Create a namespace package that mixes Rust extension modules with pure Python code.
- Cross-compile Rust extensions for deployment on different architectures.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are writing Python extensions in Rust.
The plugin is actively maintained, has no known vulnerabilities, low install friction, and permissive licensing. It is the standard way to package Rust extensions for PyPI distribution. Install it only in your build-system requirements (pyproject.toml), not as a runtime dependency.
Install
setuptools-rust on PyPI
Before you install
Low install friction; pure Python wheel with only setuptools and semantic_version as runtime dependencies. Actively maintained with recent releases and 677 repository stars.
Requires Rust toolchain (rustc, cargo) installed on the build system; Python 3.9 or later.
License in practice
MIT-licensed under permissive terms, allowing use in commercial and private projects without significant restrictions.
Quickstart
# In pyproject.toml:
[build-system]
requires = ["setuptools", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[[tool.setuptools-rust.ext-modules]]
target = "my_module._lib"
binding = "PyO3"
# Then build and install:
python -m pip install -e .
Verify before relying
- Whether cross-compilation support (crossenv, cross, cargo-zigbuild) is production-ready or experimental.
- Performance overhead or compilation time impact compared to C extensions.
- Whether binary wheel distribution is supported on all major platforms (Linux, macOS, Windows).
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagessetuptoolssemantic_version |
| Maintenance | Actively maintained 48 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,925,523 / month, #1,809 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: Version Control |
Evidence: setuptools_rust-1.13.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “rust python extension”
- setuptools-rustsetuptools-rust is a setuptools plugin that compiles and packages…
- chalkpy-rsProvides a native Rust extension package that serves as the compiled…
- phonorsPhonors provides Rust-accelerated numerical kernels for phonopy and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Version Control packages
Automatically extracts and manages Python package versions from git or Mercurial metadata instead of hardcoding them, and includes SCM-tracked files in source distributions.
Dulwich provides pure Python access to Git repositories—both local and remote—without requiring Git or native code to be installed, offering an alternative to calling Git directly.
pygit2 provides Python bindings to libgit2, enabling direct programmatic access to Git repository operations at the plumbing level without shelling out to the git command-line tool.
A Poetry plugin that automatically derives and injects version numbers from version control tags into your project during builds, using Dunamai to support multiple VCS systems.
Install it if you use Poetry 1.2.0+ and want to eliminate manual version management in your build workflow.
Parses and applies patch files in multiple diff formats (unified, context, normal, ed, rcs) and from several source control systems (Git, SVN, CVS).
Automatically determines your Python package's version from Git or Mercurial tags and writes it to your build system, with customizable version formatting and optional runtime file generation.
See also maturin · puccinialin · result · advent-of-code · cargo-lambda · retworkx · pybigtools · chia-rs · pip-hello-world · moviepilot-rust