Skip to content

Commit 61b0603

Browse files
authored
Merge pull request #143 from PyO3/davidhewitt-patch-1
docs: improve `RustExtension` arguments
2 parents 503c339 + 915390c commit 61b0603

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

setuptools_rust/extension.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,28 +50,31 @@ class RustExtension:
5050
"""Used to define a rust extension module and its build configuration.
5151
5252
Args:
53-
target: The full name of the extension, including any packages i.e.
54-
*not* a filename or pathname, but Python dotted name. It is possible to
55-
specify multiple binaries, if extension uses ``Binding.Exec`` binding mode.
56-
In that case first argument has to be dictionary. Keys of the
57-
dictionary corresponds to compiled rust binaries and values are full
58-
name of the executable inside python package.
59-
path: Path to the ``Cargo.toml`` manifest file
60-
args: A list of extra argumenents to be passed to cargo.
61-
features: A list of features to also build.
53+
target: The full Python dotted name of the extension, including any
54+
packages, i.e *not* a filename or pathname. It is possible to
55+
specify multiple binaries, if extension uses ``Binding.Exec``
56+
binding mode. In that case first argument has to be dictionary.
57+
Keys of the dictionary corresponds to compiled rust binaries and
58+
values are full name of the executable inside python package.
59+
path: Path to the ``Cargo.toml`` manifest file.
60+
args: A list of extra argumenents to be passed to Cargo. For example,
61+
``args=["--no-default-features"]`` will disable the default
62+
features listed in ``Cargo.toml``.
63+
features: A list of Cargo features to also build.
6264
rust_version: Minimum Rust compiler version required for this
6365
extension.
6466
quiet: Suppress Cargo's output.
6567
debug: Controls whether ``--debug`` or ``--release`` is passed to
66-
cargo. If set to `None` (the default) then build type is auto-detect.
67-
Inplace build is debug build otherwise release.
68-
binding: Controls which python binding is in use.
68+
Cargo. If set to `None` (the default) then build type is
69+
automatic: ``inplace`` build will be a debug build, ``install``
70+
and ``wheel`` builds will be release.
71+
binding: Informs ``setuptools_rust`` which Python binding is in use.
6972
strip: Strip symbols from final file. Does nothing for debug build.
7073
script: Generate console script for executable if ``Binding.Exec`` is
7174
used.
7275
native: Build extension or executable with ``--target-cpu=native``.
73-
optional: if it is true, a build failure in the extension will not
74-
abort the build process, but instead simply not install the failing
76+
optional: If it is true, a build failure in the extension will not
77+
abort the build process, and instead simply not install the failing
7578
extension.
7679
py_limited_api: Similar to ``py_limited_api`` on
7780
``setuptools.Extension``, this controls whether the built extension

0 commit comments

Comments
 (0)