Maturin

CropCode·2025년 10월 12일

maturin

Build and publish crates with pyo3, cffi cand uniffi bindings as well as rust binaries as python packages with minimal configuration. It supports building wheels for python 3.8 + on Windows, LLinux, macOS and FreeBSD,

can upload them to pypi and has basic PyPy and GraalPy support.

pyo3, cffi, uniffi 바인딩을 사용하는 크레이트 (crate) 및 러스트(Rust) 바이너리를 최소한의 설정을 파이썬 패키지로 빌드하고 배포합니다. Windows, Linux, macOS, FreeBSD에서 Python 3.8 이상 버전을 위한 휠(wheel) 빌드를 지원하며, 이를 PyPI에 업로드할 수 있고, 기본적인 PyPI에 업로드할 수 있고, 기본적인 PyPy 및 GraalPy 지원을 포함합니다.

  • wheels : Python의 빌드된 패키지 형식(built-package format) 중 하나입니다. 소스 코드를 매번 컴파일할 필요 없이 빠르게 설치할 수 있도록 미리 컴파일된 파일을 담고 있습니다.
  • PyPI: Python Package Index의 약자로, 파이썬 패키지를 위한 공식 소프트웨어 저장

사용법
You can either download binaries from the latest release or install it with pipx or uv:

pipx

pipx install maturin

uv

uv tool install maturin

pipx를 사용해서 maturin을 다운로드 할 수 있고, uv를 사용해서 다운로드 하실 수 있습니다.

Build

개발 빌드 For Development Build

maturin develop --release

이것은

  • 러스트 코드를 컴파일 하고
  • wheel을 만들고
  • 현재 파이썬 환경에 설치합니다.

제품 빌드 Production build

배포를 만들기 위해서는

maturin build --release

를 사용하면
target/wheels/에 .whl 파일이 생성이됩니다.
확인하셔서

pip install target/wheels/[프로젝트 이름]-*.whl

과 같이 설치하시면 충분합니다.

profile
Rust와 비전 인공지능, 카메라

0개의 댓글