def buildflit_wininst(root, python_exe=None, copy_to=None, verbose=False):
    """Build Wheel from Python package located in *root* with flit."""
    python_exe = python_exe or sys.executable
    cmd = [python_exe, '-m', 'flit', 'build']
    if verbose:
        subprocess.call(cmd, cwd=root)
    else:
        subprocess.Popen(cmd, cwd=root, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    distdir = Path(root) / 'dist'
    if not distdir.is_dir():
        raise RuntimeError(
            "Build failed: see package README file for further details regarding installation requirements.\n\n"
            "For more concrete debugging infos, please try to build the package from the command line:\n"
            "1. Open a WinPython command prompt\n"
            "2. Change working directory to the appropriate folder\n"
            "3. Type `python -m flit build`"
        )
    for distname in os.listdir(distdir):
        if re.match(SOURCE_PATTERN, distname) or re.match(WHEELBIN_PATTERN, distname):
            break
    else:
        raise RuntimeError(f"Build failed: not a pure Python package? {distdir}")

    src_fname = distdir / distname
    if copy_to:
        dst_fname = Path(copy_to) / distname
        shutil.move(src_fname, dst_fname)
        if verbose:
            print(f"Move: {src_fname} --> {dst_fname}")
Build Wheel from Python package located in *root* with flit.
winpython/utils.py