B Re2%@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+e,e-Z.e/dej0Z1ddZ2ddZ3ddZ4ddZ5ddZ6ddZ7ddZ8d d!Z9d"d#Z:d$d%Z;d&d'ZdS||sXtd|jdS|jsvtsvtd|jdSdS)zBReturn whether an InstallRequirement should be built into a wheel.Fz(Skipping %s, due to already being wheel.TzCSkipping wheel build for %s, due to binaries being disabled for it.zOUsing legacy 'setup.py install' for %s, since package 'wheel' is not installed.) constraintis_wheelloggerinfonameeditable source_dir use_pep517r)req need_wheelcheck_binary_allowedrrr _should_build.s,   r)cCst|dtdS)NT)r'r()r) _always_true)r&rrrshould_build_for_wheel_command[sr+cCst|d|dS)NF)r'r()r))r&r(rrr should_build_for_install_commanddsr,cCs|js |jsdS|jrb|jjrb|jr(t|js2tt|jj}|sHt||jj |jr^dSdS|jslt|j \}}t |rdSdS)z Return whether a built InstallRequirement can be stored in the persistent wheel cache, assuming the wheel cache is available, and _should_build() has determined a wheel needs to be built. FT) r#r$linkis_vcsAssertionErrorrget_backend_for_schemeschemeis_immutable_rev_checkouturlsplitextr)r& vcs_backendbaseextrrr _should_cachens    r8cCs>t|j}|jst|r.t|r.||j}n ||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*c Cs`y t|Wn2tk r>}ztd|j|dSd}~XYnX|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 j |}t j ||}y@t|\}} t||td|j|| |td||Stk r} ztd|j| Wdd} ~ XYnX|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          rCcCsVt|j|d}td|jyt||jddStk rPtd|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 ggfStdddd|Dttgg}}xb|D]Z}t||}t||||}|rtt||_|jj |_ |jj st | |q@| |q@WWdQRX|rtdddd |D|rtd dd 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