def METHOD_NAME(args):
    nocompress_file = args.directory / '.nocompress'
    if 1:
        comp_type = ZIP_ZSTANDARD
        comp_level = 20
    else:
        comp_type = ZIP_DEFLATED
        comp_level = 9
    try:
        nocompress = list(map(re.compile, filter(None, nocompress_file.read_text().strip().split('\n'))))
    except FileNotFoundError:
        nocompress = []
        nocompress_file = None
    zkwargs = {}
    if (sys.version_info.major, sys.version_info.minor) >= (3, 7):
        zkwargs['compresslevel'] = comp_level
    dependencies = []
    with ZipFile(str(args.output), 'w', comp_type, **zkwargs) as zf:
        for path in sorted(args.directory.glob('**/*')):
            if path.name[0] == '.' or any(path.match(x) for x in args.exclude):
                continue
            relpath = path.relative_to(args.directory)
            if path.is_dir():
                zi = ZipInfo(str(relpath) + "/", datetime.fromtimestamp(path.stat().st_mtime).timetuple())
                zi.compress_type = ZIP_STORED
                zi.external_attr = 0o40755 << 16  # drwxr-xr-x
                log_file(path, zi.filename)
                zf.writestr(zi, '')
            else:
                dependencies.append(path)
                if path.suffix == '.zst':
                    write_zst_file(zf, path, str(relpath.with_suffix('')))
                else:
                    ctype = comp_type
                    for pattern in nocompress:
                        if pattern.match(str(relpath)):
                            ctype = ZIP_STORED
                            break
                    log_file(path, relpath, ctype)
                    zf.write(str(path), str(relpath), compress_type=ctype)
    if args.depfile is not None:
        if nocompress_file is not None:
            dependencies.append(nocompress_file)
        dependencies.append(Path(__file__).resolve())
        write_depfile(args.depfile, args.output, dependencies)