def build_rust_cmdclass(cargo_toml_path, debug=False,
extra_cargo_args=None, quiet=False):
"""
Args:
cargo_toml_path (str) The path to the cargo.toml manifest
(--manifest)
debug (boolean) Controls whether --debug or --release is
passed to cargo.
extra_carg_args (list) A list of extra argumenents to be passed to
cargo.
quiet (boolean) If True, doesn't echo cargo's output.
Returns:
A Command subclass suitable for passing to the cmdclass argument
of distutils.
"""
# Manufacture a once-off command class here and set the params on it as
# class members, which it can retrieve later in initialize_options.
# This is clumsy, but distutils doesn't give you an appropriate
# hook for passing params to custom command classes (and it does the
# instantiation).
_args = locals()
class RustBuildCommand_Impl(RustBuildCommand):
args = _args
return RustBuildCommand_Impl
评论列表
文章目录