ó BuÆ_c@sÿdZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZmZmZddlmZdd lmZdd lmZdd lmZdd lmZdd lmZertddlmZm 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+nej,e-ƒZ.ej/dej0ƒZ1d„Z2d„Z3d„Z4d„Z5d„Z6d„Z7d„Z8d„Z9d„Z:d„Z;d„Z<dS(s;Orchestrator for building wheels from InstallRequirements. iÿÿÿÿN(tLink(tbuild_wheel_pep517(tbuild_wheel_legacy(t indent_log(t ensure_dirt hash_filetis_wheel_installed(tmake_setuptools_clean_args(tcall_subprocess(t TempDirectory(tMYPY_CHECK_RUNNING(t path_to_url(tvcs(tAnytCallabletIterabletListtOptionaltTuple(t WheelCache(tInstallRequirements([a-z0-9_.]+)-([a-z0-9_.!+-]+)cCsttj|ƒƒS(sjDetermine whether the string looks like an egg_info. :param s: The string to parse. E.g. foo-2.1 (tboolt _egg_info_retsearch(ts((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt_contains_egg_info%scCs©|jr tS|jr6|r2tjd|jƒntS|r@tS|jsS|j rWtS||ƒsztjd|jƒtS|j r¥t ƒ r¥tjd|jƒtStS(sBReturn whether an InstallRequirement should be built into a wheel.s(Skipping %s, due to already being wheel.sCSkipping wheel build for %s, due to binaries being disabled for it.sOUsing legacy 'setup.py install' for %s, since package 'wheel' is not installed.( t constrainttFalsetis_wheeltloggertinfotnametTrueteditablet source_dirt use_pep517R(treqt need_wheeltcheck_binary_allowed((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt _should_build.s,     cCst|dtdtƒS(NR%R&(R'R t _always_true(R$((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pytshould_build_for_wheel_command[scCst|dtd|ƒS(NR%R&(R'R(R$R&((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt should_build_for_install_commanddscCs|js|j rtS|jrd|jjrdtj|jjƒ}|j|jj |jƒr`t StS|jj ƒ\}}t |ƒr‰t StS(sÍ 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. ( R!R"Rtlinktis_vcsR tget_backend_for_schemetschemetis_immutable_rev_checkoutturlR tsplitextR(R$t vcs_backendtbasetext((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt _should_cachens  cCsLt|jƒ}|r6t|ƒr6|j|jƒ}n|j|jƒ}|S(sdReturn the persistent or temporary cache directory where the built wheel need to be stored. (Rt cache_dirR5tget_path_for_linkR+tget_ephem_path_for_link(R$t wheel_cachetcache_availableR6((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt_get_cache_dirs cCstS(N(R (t_((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyR( sc Csbyt|ƒWn*tk r:}tjd|j|ƒdSX|jt||||ƒSWdQXdS(saBuild one wheel. :return: The filename of the built wheel, or None if the build failed. s Building wheel for %s failed: %sN(RtOSErrorRtwarningRtNonet build_envt_build_one_inside_env(R$t output_dirt build_optionstglobal_optionste((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyt _build_one¥s   c CsotddƒZ}|jrQtd|jd|jd|jd|d|jƒ}n9td|jd|jd |j d |d|d|jƒ}|dk rHt jj |ƒ}t jj ||ƒ}y\t|ƒ\}} tj||ƒtjd |j|| |jƒƒtjd |ƒ|SWqHtk rD} tjd |j| ƒqHXn|jsat||ƒndSWdQXdS(NtkindtwheelRtbackendtmetadata_directoryRCttempdt setup_py_pathR"RDs3Created wheel for %s: filename=%s size=%d sha256=%ssStored in directory: %ss Building wheel for %s failed: %s(R R#RRtpep517_backendRJtpathRRLtunpacked_source_directoryR?tostbasenametjoinRtshutiltmoveRRt hexdigestt ExceptionR>t_clean_one_legacy( R$RBRCRDttemp_dirt wheel_patht wheel_namet dest_patht wheel_hashtlengthRE((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyRAÀsB             cCsot|jd|ƒ}tjd|jƒyt|d|jƒtSWn%tk rjtj d|jƒt SXdS(NRDsRunning setup.py clean for %stcwds Failed cleaning build dir for %s( RRLRRRRR"R RVterrorR(R$RDt clean_args((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pyRWós   c CsF|sggfStjddjd„|DƒƒƒtƒŽgg}}xy|D]q}t||ƒ}t||||ƒ}|rµtt|ƒƒ|_|jj |_ |j |ƒqQ|j |ƒqQWWdQX|rtjddjg|D]}|j ^q胃n|r<tjddjg|D]}|j ^q ƒƒn||fS(s˜Build wheels. :return: The list of InstallRequirement that succeeded to build and the list of InstallRequirement that failed to build. s*Building wheels for collected packages: %ss, css|]}|jVqdS(N(R(t.0R$((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pys sNsSuccessfully built %st sFailed to build %s( RRRRRR;RFRR R+t file_pathtlocal_file_pathtappendR( t requirementsR9RCRDtbuild_successestbuild_failuresR$R6t wheel_file((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pytbuilds2     ))(=t__doc__tloggingtos.pathRPtreRStpip._internal.models.linkRt$pip._internal.operations.build.wheelRt+pip._internal.operations.build.wheel_legacyRtpip._internal.utils.loggingRtpip._internal.utils.miscRRRt$pip._internal.utils.setuptools_buildRtpip._internal.utils.subprocessRtpip._internal.utils.temp_dirR tpip._internal.utils.typingR tpip._internal.utils.urlsR tpip._internal.vcsR ttypingR RRRRRtpip._internal.cacheRtpip._internal.req.req_installRRtBinaryAllowedPredicatet BuildResultt getLoggert__name__Rtcompilet IGNORECASERRR'R)R*R5R;R(RFRARWRj(((sL/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/wheel_builder.pytsD    . - !    3