3 Bu_2%@sdZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZmZmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZerddlmZm Z m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(e e(ge)fZ*e$e"e(e"e(fZ+ej,e-Z.ej/dej0Z1ddZ2ddZ3ddZ4ddZ5ddZ6ddZ7ddZ8d d!Z9d"d#Z:d$d%Z;d&d'Zt|j}|jst|r.t|r.|j|j}n |j|j}|S)zdReturn the persistent or temporary cache directory where the built wheel need to be stored. )r cache_dirr-r/r8get_path_for_linkget_ephem_path_for_link)r& wheel_cachecache_availabler9rrr_get_cache_dirs     r>cCsdS)NTr)_rrrr*sr*cCs^y t|Wn0tk r<}ztjd|j|dSd}~XnX|jt||||SQRXdS)zaBuild one wheel. :return: The filename of the built wheel, or None if the build failed. z Building wheel for %s failed: %sN)rOSErrorr warningr" build_env_build_one_inside_env)r& output_dir build_optionsglobal_optionserrr _build_ones   rHc Cstdd}|jst|jrD|js(tt|j|j|j||jd}nt|j|j |j |||jd}|dk rt jj |}t jj ||}y@t|\}} tj||tjd|j|| |jtjd||Stk r} ztjd|j| WYdd} ~ XnX|jst||dSQRXdS)Nwheel)kind)r"backendmetadata_directoryrEtempd)r" setup_py_pathr$rFrErMz3Created wheel for %s: filename=%s size=%d sha256=%szStored in directory: %sz Building wheel for %s failed: %s)r r"r/r%rLrpep517_backendpathrrNunpacked_source_directoryosbasenamejoinrshutilmover r! hexdigest ExceptionrA_clean_one_legacy) r&rDrErFtemp_dir wheel_path wheel_name dest_path wheel_hashlengthrGrrrrCsF          rCc CsVt|j|d}tjd|jyt||jddStk rPtjd|jdSXdS)N)rFzRunning setup.py clean for %s)cwdTz Failed cleaning build dir for %sF) r rNr r!r"r r$rXerror)r&rF clean_argsrrrrYsrYc Cs|s ggfStjddjdd|Dttgg}}xb|D]Z}t||}t||||}|rtt||_|jj |_ |jj st |j |q@|j |q@WWdQRX|rtjddjdd |D|rtjd djd d |D||fS) zBuild wheels. :return: The list of InstallRequirement that succeeded to build and the list of InstallRequirement that failed to build. z*Building wheels for collected packages: %sz, css|] }|jVqdS)N)r").0r&rrr szbuild..NzSuccessfully built %s cSsg|] }|jqSr)r")rcr&rrr ,szbuild..zFailed to build %scSsg|] }|jqSr)r")rcr&rrrrf1s)r r!rTrr>rHrr r- file_pathlocal_file_pathrr/append) requirementsr<rErFbuild_successesbuild_failuresr&r9 wheel_filerrrbuilds4        rn)=__doc__loggingos.pathrRrerUpip._internal.models.linkr$pip._internal.operations.build.wheelr+pip._internal.operations.build.wheel_legacyrpip._internal.utils.loggingrpip._internal.utils.miscrrr$pip._internal.utils.setuptools_buildr pip._internal.utils.subprocessr pip._internal.utils.temp_dirr pip._internal.utils.typingr pip._internal.utils.urlsr pip._internal.vcsrtypingrrrrrrpip._internal.cacherZpip._internal.req.req_installrrZBinaryAllowedPredicateZ BuildResult getLogger__name__r compile IGNORECASErrr)r+r,r8r>r*rHrCrYrnrrrrsD               -  !3