Crate maturin

Source
Expand description

Builds wheels from a crate that exposes python bindings through pyo3

The high-level api is BuildOptions, which can be converted into the BuildContext, which then uses compile() and builds the appropriate wheels.

§Cargo features

Default features: log, upload, rustls

  • log: Configures pretty-env-logger, even though maturin doesn’t use logging itself.

  • upload: Uses ureq to add the upload command.

  • rustls: Makes ureq use the rustls stack so that we can build maturin in a CentOS 6 docker container and which maturin itself manylinux compliant.

  • native-tls: Makes ureq use the platform native tls stack

  • password-storage (off by default): Uses the keyring package to store the password. keyring pulls in a lot of shared libraries and outdated dependencies, so this is off by default, except for the build on the github releases page. (https://github.com/hwchen/secret-service-rs/issues/9)

Re-exports§

pub use crate::pyproject_toml::PyProjectToml;

Modules§

ci
Generate CI configuration
pyproject_toml
A pyproject.toml as specified in PEP 517

Structs§

Bindings
The name and version of the bindings crate
BuildArtifact
A cargo build artifact
BuildContext
Contains all the metadata required to build the crate
BuildOptions
High level API for building wheels from a crate which is also used for the CLI
CargoOptions
Cargo options for the build process
CargoToml
Extract of the Cargo.toml that can be reused for the python metadata
DevelopOptions
Install the crate as module in the current virtualenv
GenerateProjectOptions
Options common to maturin new and maturin init.
Metadata24
Python Package Metadata 2.4 as specified in https://packaging.python.org/specifications/core-metadata/ Maturin writes static metadata and does not support dynamic fields atm.
PathWriter
A ModuleWriter that adds the module somewhere in the filesystem, e.g. in a virtualenv
PublishOpt
An account with a registry, possibly incomplete
PythonInterpreter
The location and version of an interpreter
Registry
A pip registry such as pypi or testpypi with associated credentials, used for uploading wheels
SDistWriter
Creates a .tar.gz archive containing the source distribution
Target
The part of the current platform that is relevant when building wheels and is supported
WheelMetadata
The metadata required to generate the .dist-info directory
WheelWriter
A glorified zip builder, mostly useful for writing the record file of a wheel

Enums§

BridgeModel
The way the rust code is used in the wheel
PlatformTag
Decides how to handle manylinux and musllinux compliance
UploadError
Error type for different types of errors that can happen when uploading a wheel.

Traits§

ModuleWriter
Allows writing the module to a wheel or add it directly to the virtualenv

Functions§

compile
Builds the rust crate into a native module (i.e. an .so or .dll) for a specific python version. Returns a mapping from crate type (e.g. cdylib) to artifact location.
develop
Installs a crate by compiling it and copying the shared library to site-packages. Also adds the dist-info directory to make sure pip and other tools detect the library
init_project
Generate a new cargo project in an existing directory
new_project
Generate a new cargo project
upload
Uploads a single wheel to the registry
upload_ui
Handles authentication/keyring integration and retrying of the publish subcommand
write_dist_info
Creates the .dist-info directory and fills it with all metadata files except RECORD

Type Aliases§

BuiltWheelMetadata
The wheel file location and its Python version tag (e.g. py3).