How to use the delocate.tools.dir2zip function in delocate

To help you get started, we’ve selected a few delocate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matthew-brett / delocate / delocate / wheeltools.py View on Github external
def __exit__(self, exc, value, tb):
        if self.out_wheel is not None:
            rewrite_record(self.name)
            dir2zip(self.name, self.out_wheel)
        return super(InWheel, self).__exit__(exc, value, tb)
github matthew-brett / delocate / delocate / delocating.py View on Github external
raise DelocationError(
                        "Some missing architectures in wheel")
            # Change install ids to be unique within Python space
            install_id_root = (DLC_PREFIX +
                               relpath(package_path, wheel_dir) +
                               '/')
            for lib in copied_libs:
                lib_base = basename(lib)
                copied_path = pjoin(lib_path, lib_base)
                set_install_id(copied_path, install_id_root + lib_base)
                validate_signature(copied_path)
            _merge_lib_dict(all_copied, copied_libs)
        if len(all_copied):
            rewrite_record(wheel_dir)
        if len(all_copied) or not in_place:
            dir2zip(wheel_dir, out_wheel)
    return stripped_lib_dict(all_copied, wheel_dir + os.path.sep)
github matthew-brett / delocate / delocate / fuse.py View on Github external
---------
    to_wheel : str
        filename of wheel to fuse into
    from_wheel : str
        filename of wheel to fuse from
    out_wheel : str
        filename of new wheel from fusion of `to_wheel` and `from_wheel`
    """
    to_wheel, from_wheel, out_wheel = [
        abspath(w) for w in (to_wheel, from_wheel, out_wheel)]
    with InTemporaryDirectory():
        zip2dir(to_wheel, 'to_wheel')
        zip2dir(from_wheel, 'from_wheel')
        fuse_trees('to_wheel', 'from_wheel')
        rewrite_record('to_wheel')
        dir2zip('to_wheel', out_wheel)