import gzip
import shutil


def compress_gzip(file_path: str, out_path: str) -> str:
    """Compress a file into gzip.

    Args:
        file_path: Path to file
        out_dir: Path to compressed file

    Returns:
        Path to compressed file
    """
    with open(file_path, 'rb') as f, gzip.open(out_path, 'wb') as out:
        shutil.copyfileobj(f, out)
    return out_path