def METHOD_NAME(version: str, filepath: str) -> None:
    with open(filepath, encoding="utf-8") as f:
        content = list(f)
    file_modified = False
    with open(filepath, "w", encoding="utf-8") as f:
        for line in content:
            if line.startswith("__version__ ="):
                f.write(f'__version__ = "{version}"\n')
                file_modified = True
            else:
                f.write(line)
    assert file_modified, f"Version file {filepath} did not get modified"