ó â\e[c@stdZddlZddlZddlmZmZddlmZddlm Z ddl m Z m Z m Z mZmZddlmZmZmZmZmZddlmZdd lmZdd lmZmZdd lmZeje ƒZ!d „Z"d e#fd„ƒYZ$de$fd„ƒYZ%de$fd„ƒYZ&de$fd„ƒYZ'de#fd„ƒYZ(dS(s)Prepares a distribution for installation iÿÿÿÿN(t pkg_resourcestrequests(tBuildEnvironment(t expanduser(t is_dir_urlt is_file_urlt is_vcs_urlt unpack_urlt url_to_path(tDirectoryUrlHashUnsupportedt HashUnpinnedtInstallationErrortPreviousBuildDirErrortVcsHashUnsupported(t MissingHashes(t indent_log(t display_pathtnormalize_path(tvcscCs@|jrt|ƒS|jr2|jjr2t|ƒSt|ƒSdS(sãFactory to make an abstract dist object. Preconditions: Either an editable req with a source_dir, or satisfied_by or a wheel link, or a non-editable req with a source_dir. :return: A concrete DistAbstraction. N(teditabletIsSDisttlinktis_wheeltIsWheel(treq((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pytmake_abstract_dists    tDistAbstractioncBs)eZdZd„Zd„Zd„ZRS(syAbstracts out the wheel vs non-wheel Resolver.resolve() logic. The requirements for anything installable are as follows: - we must be able to determine the requirement name (or we can't correctly handle the non-upgrade case). - we must be able to generate a list of run-time dependencies without installing any additional packages (or we would have to either burn time by doing temporary isolated installs or alternatively violate pips 'don't start installing unless all requirements are available' rule - neither of which are desirable). - for packages with setup requirements, we must also be able to determine their requirements without installing additional packages (for the same reason as run-time dependencies) - we must be able to create a Distribution object exposing the above metadata. cCs ||_dS(N(R(tselfR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyt__init__=scCst|jƒ‚dS(s Return a setuptools Dist object.N(tNotImplementedErrortdist(Rtfinder((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR@scCst|jƒ‚dS(s3Ensure that we can get a Dist for this requirement.N(RR(RR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyt prep_for_distDs(t__name__t __module__t__doc__RRR (((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR*s  RcBseZd„Zd„ZRS(cCsttj|jjƒƒdS(Ni(tlistRtfind_distributionsRt source_dir(RR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRKs cCsdS(N((RRtbuild_isolation((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR Os(R!R"RR (((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRIs RcBseZd„Zd„ZRS(cCsA|jjƒ}|r=|jdƒr=|j|jdƒƒn|S(Nsdependency_links.txt(Rtget_distt has_metadatatadd_dependency_linkstget_metadata_lines(RRR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRVs cCsÎ|jjƒ}|o|dk }|r°ddhd„|Dƒ}|r…tjd|jƒtjddjttt|ƒƒƒƒnt ƒ|j_ |jj j ||dƒn|jj ƒ|jj ƒdS(Nt setuptoolstwheelcSs"h|]}tj|ƒj’qS((Rt Requirementtkey(t.0tr((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pys is s4Missing build requirements in pyproject.toml for %s.sUThis version of pip does not implement PEP 517 so it cannot build a wheel without %s.s and sInstalling build dependencies(Rtget_pep_518_infotNonetloggertwarningtjointmaptreprtsortedRt build_envtinstall_requirementst run_egg_infotassert_source_matches_version(RRR'tbuild_requirementstshould_isolatetmissing_requirements((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR _s$  "   (R!R"RR (((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRTs t InstalledcBseZd„Zd„ZRS(cCs |jjS(N(Rt satisfied_by(RR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR„scCsdS(N((RR((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyR ‡s(R!R"RR (((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRA‚s tRequirementPreparercBsAeZdZd„Zed„ƒZd„Zd„Zd„ZRS(sPrepares a Requirement cCsktt|ƒjƒ||_||_||_||_|rLt|ƒ}n||_||_ ||_ dS(N( tsuperRCRtsrc_dirt build_dirt req_trackert download_dirRtwheel_download_dirt progress_barR'(RRFRHRERIRJR'RG((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRs      cCsa|jr]t|jƒ|_tjj|jƒr4tStjdƒtdt |jƒƒ‚nt S(Ns!Could not find download directorys0Could not find or access download directory '%s'( RHRtostpathtexiststTrueR4tcriticalR RtFalse(R((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyt_download_should_save¬s  c Cs°|jrF|jjdkrFt|jjƒ}tjdt|ƒƒntjd|ƒtƒK|j|j ƒt j j t j j |jdƒƒr°td||jfƒ‚n|j|||ƒ|jsÒt‚|j}|r@t|ƒrùtƒ‚n$t|ƒrt|ƒrtƒ‚n|j r@|j r@tƒ‚q@n|jd| ƒ}|rl| rltƒ}ny†|j} t} |jjrŸ|jrŸ|j} n|jjrÃ| rºt} qÃt } nt!|j|j| | d|d|d |j"ƒWnEt#j$k r9} tj%d || ƒt&d || |jfƒ‚nXt'|ƒ} |j(j)|ƒ| j*||j+ƒWd QX|j,r¦|jjt-j.kr¦|j/|jƒq¦nWd QX| S( sCPrepare a requirement that would be obtained from req.link tfiles Processing %ss Collecting %sssetup.pysípip can't proceed with requirements '%s' due to a pre-existing build directory (%s). This is likely due to a previous installation that failed. pip is being responsible and not assuming it can delete this. Please delete it and try again.ttrust_internettsessionthashesRJs4Could not install requirement %s because of error %ssDCould not install requirement %s because of HTTP error %s for URL %sN(0RtschemeRturlR4tinfoRRtensure_has_source_dirRFRKRLRMR6R&R t populate_linktAssertionErrorRR RRR t original_linkt is_pinnedR RURRHRNRRIRPRRJRt HTTPErrorROR RRGttrackR R'RQRt all_schemestarchive( RRRTRtupgrade_allowedtrequire_hashesRLRRURHtautodelete_unpackedtexct abstract_dist((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pytprepare_linked_requirementºsh $                 c CsÔ|jstdƒ‚tjd|ƒtƒ |rHtd|ƒ‚n|j|jƒ|j|j ƒt |ƒ}|j j |ƒ|j ||jƒWdQX|j r½|j|jƒn|j|ƒWdQX|S(s(Prepare an editable requirement s-cannot prepare a non-editable req as editables Obtaining %ssoThe editable requirement %s cannot be installed when requiring hashes, because there is no single file to hash.N(RR[R4RXRR RYREtupdate_editableRQRRGR_R R'RaRHtcheck_if_exists(RRRct use_user_siteRRf((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pytprepare_editable_requirement1s     cCs‰|jstdƒ‚|dk s7td|jfƒ‚tjd|||jjƒtƒ'|rstjdƒnt|ƒ}WdQX|S(s1Prepare an already-installed requirement s(req should have been satisfied but isn'tsAdid not get skip reason skipped but req.satisfied_by is set to %rsRequirement %s: %s (%s)s§Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.N( RBR[R3R4RXtversionRtdebugRA(RRRct skip_reasonRf((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pytprepare_installed_requirementMs  ( R!R"R#RtpropertyRQRgRkRo(((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyRC‹s   w ()R#tloggingRKt pip._vendorRRtpip._internal.build_envRtpip._internal.compatRtpip._internal.downloadRRRRRtpip._internal.exceptionsR R R R R tpip._internal.utils.hashesRtpip._internal.utils.loggingRtpip._internal.utils.miscRRtpip._internal.vcsRt getLoggerR!R4RtobjectRRRRARC(((s?/tmp/pip-install-0xiv62/pip/pip/_internal/operations/prepare.pyts$  ((  .