a lj @sddlZddlZddlmZmZddlmZddlm Z ddl m Z m Z m Z eeZeeeedddZeeeeeeeeed d d Zeeeeeeeeeed d dZdS)N)ListOptional) open_spinner) make_setuptools_bdist_wheel_args) LOG_DIVIDERcall_subprocessformat_command_args) command_argscommand_outputreturncCsbt|}d|d}|s"|d7}nReturn the path to the wheel in the temporary build directory.z1Legacy build of wheel for {!r} created no files. NzZLegacy build of wheel for {!r} created more than one file. Filenames (choosing first): {} r) sortedformatrr Zwarninglenospathjoin)rrrr r msgrrrget_legacy_build_wheel_path$s     r )r setup_py_path source_dirglobal_options build_optionstempdr c Cst||||d}d|d}t|}td|zt|||d} Wn6tyz|dtd|YWddS0t |} t | |||| d } | WdS1s0YdS) zBuild one unpacked package using the "legacy" build process. Returns path to wheel if successfully built. Otherwise, returns None. )r#r$Zdestination_dirzBuilding wheel for z (setup.py)zDestination directory: %s)cwdspinnererrorzFailed building wheel for %sN)rrrr r ) rrr debugr ExceptionZfinishr(rlistdirr ) rr!r"r#r$r%Z wheel_argsZ spin_messager'outputrZ wheel_pathrrrbuild_wheel_legacy?s8         r-)rZos.pathrtypingrrZpip._internal.cli.spinnersrZ$pip._internal.utils.setuptools_buildrZpip._internal.utils.subprocessrrrZ getLogger__name__r strrr r-rrrrs2