Type object
Schema URL https://catalog.lintel.tools/schemas/schemastore/pyproject/_shared/latest--maturin.json
Parent schema pyproject
Type: object

The [tool.maturin] section of a pyproject.toml

Properties

all-features boolean | null

Activate all available features

auditwheel AuditWheelMode | null

Audit wheel mode

bindings string | null

Bindings type

compatibility PlatformTag | null

Platform compatibility

config array | null

Override a configuration value (unstable)

data string | null

Path to the wheel directory, defaults to <module_name>.data

editable-profile string | null

Same as profile but for "editable" builds

exclude array | null

Exclude files matching the given glob pattern(s). Patterns are resolved relative to the directory containing pyproject.toml.

features array | null

List of features to activate. Each entry can be a plain feature name string, or a conditional object with feature and python-version keys.

frozen boolean | null

Require Cargo.lock and cache are up to date

generate-ci GenerateCIConfig | null

CI generation configuration

include array | null

Include files matching the given glob pattern(s). Patterns are resolved relative to the directory containing pyproject.toml. When python-source is configured, patterns are also tried relative to that directory if no matches are found.

include-import-lib boolean

Include the import library (.dll.lib) in the wheel on Windows

Default: false
locked boolean | null

Require Cargo.lock is up to date

manifest-path string | null

Path to Cargo.toml

module-name string | null

Module name, accepts setuptools style import name like foo.bar

no-default-features boolean | null

Do not activate the default feature

profile string | null

Build artifacts with the specified Cargo profile

python-packages array | null

Python packages to include

python-source string | null

The directory with python module, contains <module_name>/__init__.py

rustc-args array | null

Additional rustc arguments

sbom SbomConfig | null

SBOM configuration

sdist-generator string | string

Source distribution generator

skip-auditwheel boolean

Skip audit wheel

Default: false
strip boolean

Strip the final binary

Default: false
target Record<string, object>

Target configuration

Default:
{}
targets array | null

Cargo compile targets

unstable-flags array | null

Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details

use-base-python boolean

Use base Python executable instead of venv Python executable in PEP 517 build.

Default: false

Definitions

AuditWheelMode string | string | string | string

Auditwheel mode

CargoCrateType string | string | string | string | string | string

Supported cargo crate types

CargoTarget object

Cargo compile target

name string required

Name as given in the Cargo.toml or generated from the file name

kind CargoCrateType | null

Kind of target ("bin", "cdylib")

FeatureSpec string | object

A cargo feature specification that can be either a plain feature name or a conditional feature that is only enabled for certain Python versions.

Examples

[tool.maturin]
features = [
  "some-feature",
  { feature = "pyo3/abi3-py311", python-version = ">=3.11" },
  { feature = "pyo3/abi3-py38", python-version = "<3.11" },
  { feature = "pyo3/abi3-py311", python-version = ">=3.11", python-implementation = "cpython" },
  { feature = "pypy-compat", python-implementation = "pypy" },
]
Format string | string

The target format for the include or exclude [GlobPattern].

See [Formats].

Formats Format | Format[]

A single [Format] or multiple [Format] values for a [GlobPattern].

GenerateCIConfig object

The [tool.maturin.generate-ci] section

github GitHubCIConfig | null

GitHub Actions configuration

GitHubCIConfig object

The [tool.maturin.generate-ci.github] section

android PlatformCIConfig | null

Android platform configuration

args string | null

Extra arguments to pass to maturin (applies to all platforms)

emscripten PlatformCIConfig | null

Emscripten platform configuration

linux PlatformCIConfig | null

Linux (manylinux) platform configuration

macos PlatformCIConfig | null

macOS platform configuration

musllinux PlatformCIConfig | null

Musllinux platform configuration

pytest boolean | null

Enable pytest

skip-attestation boolean | null

Skip artifact attestation

windows PlatformCIConfig | null

Windows platform configuration

zig boolean | null

Use zig for cross compilation

GlobPattern string | object | object

A glob pattern for the include and exclude configuration.

See [PyProjectToml::include] and [PyProject::exclude].

Based on https://python-poetry.org/docs/pyproject/#include-and-exclude.

IncludeFrom string

Supported values for the from field in include patterns.

PlatformCIConfig object

Per-platform CI configuration

args string | null

Extra arguments to pass to maturin

before-script-linux string | null

Script to run before build on Linux

container string | null

Container image to use

docker-options string | null

Docker options

manylinux string | null

Manylinux version (e.g. "auto", "2_28", "musllinux_1_2")

runner string | null

Default runner for this platform

rust-toolchain string | null

Rust toolchain (e.g. "nightly", "stable")

rustup-components string | null

Rustup components to install

target array | null

Detailed per-target configuration (mutually exclusive with targets)

targets array | null

Simple list of target architectures (mutually exclusive with target)

PlatformTag object | object | string | string

Decides how to handle manylinux and musllinux compliance

SbomConfig object

SBOM configuration

auditwheel boolean | null

Generate a CycloneDX SBOM for external shared libraries grafted during auditwheel repair. Defaults to true when repair copies libraries.

The SBOM is written to <dist-info>/sboms/auditwheel.cdx.json and records which OS packages (deb, rpm, apk) provided the grafted libraries, following the same convention as Python's auditwheel.

include array | null

Additional SBOM files to include in the .dist-info/sboms directory.

rust boolean | null

Generate an SBOM for Rust crates. Defaults to true.

SdistGenerator string | string

Source distribution generator

TargetCIConfig object

Per-target CI configuration within a platform

arch string required

Target architecture (e.g. "x86_64", "aarch64")

args string | null

Extra arguments to pass to maturin

before-script-linux string | null

Before-script-linux override

container string | null

Container image override

docker-options string | null

Docker options override

manylinux string | null

Manylinux version override

runner string | null

Runner override for this target

rust-toolchain string | null

Rust toolchain override

rustup-components string | null

Rustup components override

TargetConfig object

Target configuration

macos-deployment-target string | null

macOS deployment target version