rust_ext.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:cryptography-ring 作者: reaperhulk 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号