# Using pip
pip install ai-blame
# Using uv (faster)
uv add --dev ai-blame
# Using pipx (global install)
pipx install ai-blame# All CLI commands work the same
ai-blame --help
ai-blame report
ai-blame annotate --dry-run# Install maturin
pip install maturin
# Build in dev mode (editable install)
maturin develop
# Test your changes
ai-blame --version# Build optimized wheel
maturin build --release
# Wheel will be in target/wheels/
ls target/wheels/
# Test install in a fresh venv
python -m venv test-env
source test-env/bin/activate
pip install target/wheels/*.whl
ai-blame --version./test-python-build.shWheels are automatically built and published when you create a GitHub release.
Prerequisites: Configure trusted publishing on PyPI:
- Go to PyPI → Publishing → Add a new pending publisher
- Set:
- PyPI Project Name:
ai-blame - Owner: Your GitHub username/org
- Repository name:
ai-blame.rs - Workflow name:
python-wheels.yml - Environment name:
pypi
- PyPI Project Name:
To publish:
- Tag the release:
git tag v0.1.0 && git push --tags - Create GitHub release: Go to Releases → Draft a new release
- Publish: The
python-wheels.ymlworkflow will:- Build wheels for Linux (x86_64, aarch64)
- Build wheels for Windows (x64, x86)
- Build wheels for macOS (x86_64, aarch64)
- Build source distribution (sdist)
- Publish all to PyPI using OIDC trusted publishing (no token needed)
# Build all wheels locally (requires appropriate platforms)
maturin build --release --target x86_64-unknown-linux-gnu
# Upload to PyPI
maturin upload# Publish to Test PyPI first
maturin publish --repository testpypi
# Test install
pip install --index-url https://test.pypi.org/simple/ ai-blame- pyproject.toml: Configures maturin as the build backend with
bindings = "bin" - Cargo.toml: Defines the Rust binary target
[[bin]] - maturin:
- Compiles the Rust binary for the target platform
- Packages it into a Python wheel
- The wheel installs the binary into the venv's bin/ directory
- Result: Users get the Rust binary via
pip install, no Rust toolchain needed
This package contains zero Python code. It's purely a distribution mechanism for the Rust binary. The wheel includes:
- The compiled
ai-blamebinary - Metadata (version, license, dependencies)
- No Python modules or packages
Pre-built wheels for:
- Linux: x86_64, aarch64 (manylinux)
- Windows: x64, x86
- macOS: x86_64 (Intel), aarch64 (Apple Silicon)
| Method | Pros | Cons |
|---|---|---|
| PyPI (pip/uv) | Easy for Python devs, no Rust needed | Slightly larger download |
| Cargo | Native Rust, smaller binary | Requires Rust toolchain |
| Homebrew | Easy for macOS users | Platform-specific |
| Direct binary | Maximum control | Manual updates |
This distribution strategy is inspired by successful Rust tools in the Python ecosystem:
- Ruff: Python linter written in Rust, distributed via PyPI
- uv: Python package manager written in Rust, distributed via PyPI
- Pydantic Core: Validation library written in Rust, distributed via PyPI
These tools prove that Python developers readily adopt Rust-based tools when:
- Installation is easy (
pip install) - Performance is significantly better
- The interface (CLI/API) remains familiar
Q: Do Python users need Rust installed?
A: No! The wheel contains a pre-compiled binary. Just pip install and go.
Q: Is there a Python API? A: Not currently. The CLI provides all functionality. If you need programmatic access, open an issue.
Q: How big are the wheels? A: Typically around 1.4–3 MB, depending on platform and build options (for example, debug symbols). Still smaller than many Python packages with C extensions.
Q: Does this work with virtual environments? A: Yes! The binary is installed in the venv's bin/ directory like any other CLI tool.
Q: Can I use this with pipx?
A: Yes! pipx install ai-blame installs it globally.
Q: What about Windows? A: Full Windows support with pre-built wheels.