def copy_changelogs(version, searchdir, flavor="", architecture=64, basedir=None):
    """Copy all changelogs for a major.minor version into basedir."""
    basever = ".".join(str(version).split(".")[:2])
    pattern = re.compile(rf"WinPython{flavor}-{architecture}bit-{basever}[0-9\.]*\.(txt|md)")
    dest = Path(basedir)
    for fname in os.listdir(searchdir):
        if pattern.match(fname):
            shutil.copyfile(Path(searchdir) / fname, dest / fname)
Copy all changelogs for a major.minor version into basedir.
winpython/diff.py