| 1 |
Build the crate into python packages |
| 2 |
|
| 3 |
Usage: maturin[EXE] build [OPTIONS] [ARGS]... |
| 4 |
|
| 5 |
Arguments: |
| 6 |
[ARGS]... |
| 7 |
Rustc flags |
| 8 |
|
| 9 |
Options: |
| 10 |
--strip |
| 11 |
Strip the library for minimum file size |
| 12 |
|
| 13 |
--sdist |
| 14 |
Build a source distribution |
| 15 |
|
| 16 |
--compatibility [<compatibility>...] |
| 17 |
Control the platform tag and PyPI compatibility. |
| 18 |
|
| 19 |
This options offers both fine-grained control over the linux libc tag and a more automatic |
| 20 |
PyPI-compatibility option. |
| 21 |
|
| 22 |
The `pypi` option applies on all platforms and ensure that only tags that can be uploaded |
| 23 |
to PyPI are used. The linux-specific options are `manylinux` tags (for example |
| 24 |
`manylinux2014`/`manylinux_2_24`) or `musllinux` tags (for example `musllinux_1_2`), and |
| 25 |
`linux` for the native linux tag. They are ignored on non-linux platforms. |
| 26 |
|
| 27 |
Note that `manylinux1` and `manylinux2010` are unsupported by the rust compiler. Wheels |
| 28 |
with the native `linux` tag will be rejected by pypi, unless they are separately validated |
| 29 |
by `auditwheel`. |
| 30 |
|
| 31 |
The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched. |
| 32 |
|
| 33 |
-i, --interpreter [<INTERPRETER>...] |
| 34 |
The python versions to build wheels for, given as the executables of interpreters such as |
| 35 |
`python3.9` or `/usr/bin/python3.8` |
| 36 |
|
| 37 |
-f, --find-interpreter |
| 38 |
Find interpreters from the host machine |
| 39 |
|
| 40 |
-b, --bindings <BINDINGS> |
| 41 |
Which kind of bindings to use |
| 42 |
|
| 43 |
[possible values: pyo3, pyo3-ffi, cffi, uniffi, bin] |
| 44 |
|
| 45 |
-o, --out <OUT> |
| 46 |
The directory to store the built wheels in. Defaults to a new "wheels" directory in the |
| 47 |
project's target directory |
| 48 |
|
| 49 |
--auditwheel <AUDITWHEEL> |
| 50 |
Audit wheel for manylinux compliance |
| 51 |
|
| 52 |
Possible values: |
| 53 |
- repair: Audit and repair wheel for manylinux compliance |
| 54 |
- check: Check wheel for manylinux compliance, but do not repair |
| 55 |
- skip: Don't check for manylinux compliance |
| 56 |
|
| 57 |
--zig |
| 58 |
For manylinux targets, use zig to ensure compliance for the chosen manylinux version |
| 59 |
|
| 60 |
Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` |
| 61 |
|
| 62 |
Make sure you installed zig with `pip install maturin[zig]` |
| 63 |
|
| 64 |
-q, --quiet |
| 65 |
Do not print cargo log messages |
| 66 |
|
| 67 |
--ignore-rust-version |
| 68 |
Ignore `rust-version` specification in packages |
| 69 |
|
| 70 |
-v, --verbose... |
| 71 |
Use verbose output (-vv very verbose/build.rs output) |
| 72 |
|
| 73 |
--color <WHEN> |
| 74 |
Coloring: auto, always, never |
| 75 |
|
| 76 |
--config <KEY=VALUE> |
| 77 |
Override a configuration value (unstable) |
| 78 |
|
| 79 |
-Z <FLAG> |
| 80 |
Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details |
| 81 |
|
| 82 |
--future-incompat-report |
| 83 |
Outputs a future incompatibility report at the end of the build (unstable) |
| 84 |
|
| 85 |
--compression-method <COMPRESSION_METHOD> |
| 86 |
Zip compression method. Only Stored and Deflated are currently compatible with all package |
| 87 |
managers |
| 88 |
|
| 89 |
[default: deflated] |
| 90 |
|
| 91 |
Possible values: |
| 92 |
- deflated: Deflate compression (levels 0-9, default 6) |
| 93 |
- stored: No compression |
| 94 |
- bzip2: BZIP2 compression (levels 0-9, default 6) |
| 95 |
- zstd: Zstandard compression (supported from Python 3.14; levels -7-22, default 3) |
| 96 |
|
| 97 |
--compression-level <COMPRESSION_LEVEL> |
| 98 |
Zip compression level. Defaults to method default |
| 99 |
|
| 100 |
-h, --help |
| 101 |
Print help (see a summary with '-h') |
| 102 |
|
| 103 |
Compilation Options: |
| 104 |
-r, --release |
| 105 |
Build artifacts in release mode, with optimizations |
| 106 |
|
| 107 |
-j, --jobs <N> |
| 108 |
Number of parallel jobs, defaults to # of CPUs |
| 109 |
|
| 110 |
--profile <PROFILE-NAME> |
| 111 |
Build artifacts with the specified Cargo profile |
| 112 |
|
| 113 |
--target <TRIPLE> |
| 114 |
Build for the target triple |
| 115 |
|
| 116 |
[env: CARGO_BUILD_TARGET=] |
| 117 |
|
| 118 |
--target-dir <DIRECTORY> |
| 119 |
Directory for all generated artifacts |
| 120 |
|
| 121 |
--timings=<FMTS> |
| 122 |
Timing output formats (unstable) (comma separated): html, json |
| 123 |
|
| 124 |
Feature Selection: |
| 125 |
-F, --features <FEATURES> |
| 126 |
Space or comma separated list of features to activate |
| 127 |
|
| 128 |
--all-features |
| 129 |
Activate all available features |
| 130 |
|
| 131 |
--no-default-features |
| 132 |
Do not activate the `default` feature |
| 133 |
|
| 134 |
Manifest Options: |
| 135 |
-m, --manifest-path <PATH> |
| 136 |
Path to Cargo.toml |
| 137 |
|
| 138 |
--frozen |
| 139 |
Require Cargo.lock and cache are up to date |
| 140 |
|
| 141 |
--locked |
| 142 |
Require Cargo.lock is up to date |
| 143 |
|
| 144 |
--offline |
| 145 |
Run without accessing the network |