ó `8(Zc@sQdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZddlmZmZmZmZmZd „Zd efd „ƒYZd „Zed „Zeed„Zd„Zd„Zdd„Zddeeed„Z d„Z d„Z!d„Z"d„Z#dS(s Wheel command-line utility. iÿÿÿÿN(tiglobi(t signatures(t WheelFiletVerifyingZipFile(tget_install_command(turlsafe_b64decodeturlsafe_b64encodetnativetbinarytmatches_requirementcCs=yddl}Wn&tk r8tdj|ƒƒ‚nXdS(Niÿÿÿÿs/'{0}' needs pkg_resources (part of setuptools).(t pkg_resourcest ImportErrort RuntimeErrortformat(tnameR ((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytrequire_pkgresourcess t WheelErrorcBseZRS((t__name__t __module__(((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyRscCshy5ddlm}ddl}|jƒjs4t‚Wn#ttfk rZtdƒ‚nX|j|fS(Ni(tkeysiÿÿÿÿsQInstall wheel[signatures] (requires keyring, keyrings.alt, pyxdg) for signatures.( RRtkeyringt get_keyringtprioritytAssertionErrorR Rt WheelKeys(RR((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyRs  c Cs%|ƒ\}}tjƒ}|ƒjƒ}|jƒ}tt|jƒƒ}tt|jƒƒ}|jƒ}|j d||ƒt j j dj |ƒƒt j j dj |ƒƒ|jd|ƒ} | |krÞtdƒ‚nt j j dj |ƒƒ|jd|ƒ|jd|ƒ|jƒdS(s#Generate a public/private key pair.twheels$Created Ed25519 keypair with vk={0} s in {0!r} s1Keyring is broken. Could not retrieve secret key.s.Trusting {0} to sign and verify all packages. t+N(Rt get_ed25519lltloadtcrypto_sign_keypairRRtvktskRt set_passwordtsyststdouttwriteR t get_passwordRt add_signerttrusttsave( RRRt ed25519lltwktkeypairRRtkrtsk2((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytkeygen*s"    cCs”|ƒ\}}tjƒ}t|dtƒ}|ƒjƒ}|jjdƒ}|j|ƒd} tj j dj || dƒƒ| d} |j ƒ} | j d| ƒ} |jtt| ƒƒtt| ƒƒƒ} |jd}|jd}||jjƒkrtd ƒ‚n|jj|ƒ}id tttj|ƒjƒƒƒd 6}tj|| ƒ}|jj|tj|d tƒƒ|jjƒd S(s Sign a wheeltappendRisSigning {0} with {1} iRs/RECORDs /RECORD.jwssWheel is already signed.ssha256=thasht sort_keysN( RRRtTrueRtparsed_filenametgrouptsignersR!R"R#R RR$tKeypairRRt distinfo_nametzipfiletnamelistRtreadRRthashlibtsha256tdigesttsigntwritestrtjsontdumpstclose(t wheelfiletreplaceRRRR(twfR)Rt sign_withRR+RR*t record_nametsig_namet record_datatpayloadtsig((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyR=Ds*      ,"cCsdt|dƒ}|jƒ}t|ƒo:|djjdƒsLtdƒ‚n|jƒ|jƒdS(s$ Remove RECORD.jws from a wheel by truncating the zip file. RECORD.jws must be at the end of the archive. The zip file must be an ordinary archive, with the compressed files and the directory in the same order, and without any non-zip content after the truncation point. taiÿÿÿÿs /RECORD.jwssEThe wheel is not signed (RECORD.jws not found at end of the archive).N(RtinfolisttlentfilenametendswithRtpopRA(RBtvzftinfo((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytunsignbs  " cCs¶t|ƒ}|jd}y+tjt|jj|ƒjƒƒƒ}Wntk rct dƒ‚nXt j |ƒ}t j jdƒt jjtj|ddƒƒt jjdƒdS(sÌVerify a wheel. The signature will be verified for internal consistency ONLY and printed. Wheel's own unpack/install commands verify the manifest against the signature and file contents. s /RECORD.jwssEThe wheel is not signed (RECORD.jws not found at end of the archive).s&Signatures are internally consistent. tindentis N(RR6R?tloadsRR7topenR9tKeyErrorRRtverifyR!tstderrR#R"R@(RBRDRGRJtverified((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyRXrs  + t.cCsht|ƒ}|jjdƒ}tjj||ƒ}tjjd|ƒ|j j |ƒ|j j ƒdS(sUnpack a wheel. Wheel content will be unpacked to {dest}/{name}-{ver}, where {name} is the package name and {ver} its version. :param wheelfile: The path to the wheel. :param dest: Destination directory (default to current directory). tnameversUnpacking to: %s N( RR2R3tostpathtjoinR!RYR#R7t extractallRA(RBtdestRDR\t destination((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytunpack†s cCs”|sBtjdƒ}|r0|jtjƒ}qBtjjg}ng}xn|D]f}x]tj|ƒD]L} | jdƒrettjj || ƒƒ} | j r±|j | ƒq±qeqeWqOW|r;tjj |ƒsxB|D]7}tjj ||ƒ} tjj | ƒrØ| }PqØqØWnt |ƒ} |j| ƒWdQXng} xÓ|D]Ë}|jdƒrÓtjj |ƒr¸t|ƒ} | j sŠ|rš| j | ƒqÍdj|ƒ}t|ƒ‚qHtdj|ƒƒ‚qHnt||ƒ}|stdj|ƒƒ‚n| j t|ƒƒqHW|r0tjjdƒn|r:dSxS| D]K} |rotjjdj| jƒƒqAn| jd |ƒ| jjƒqAWdS( s¶Install wheels. :param requirements: A list of requirements or wheel files to install. :param requirements_file: A file containing requirements to install. :param wheel_dirs: A list of directories to search for wheels. :param force: Install a wheel file even if it is not compatible. :param list_files: Only list the files to install, don't install them. :param dry_run: Do everything but the actual install. t WHEELPATHs.whlNsB{0} is not compatible with this Python. --force to install anyway.sNo such wheel file: {}sNo match for requirement {}s Installing: s {0} tforce(R]tgetenvtsplittpathsepR^tcurdirtlistdirRORR_t compatibleR.texistsRVtextendR RR tmaxR!R"R#RNtinstallR7RA(t requirementstrequirements_filet wheel_dirsRet list_filestdry_runt wheelpatht all_wheelstdtwRDRtfdt to_installtreqtmsgtmatches((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyRo—s^        cCs¥y ddlm}ddl}Wntk r?tdƒ‚nXx^|D]V}|j|ƒ}t|ƒ}|j|jƒ}dg|_|j ƒ|j |ƒqGWdS(sQ Regenerate the entry_points console_scripts for the named distribution. iÿÿÿÿ(t easy_installNs)'wheel install_scripts' needs setuptools.R( tsetuptools.commandR~R R R tget_distributionRt distributiontargstfinalize_optionstinstall_egg_scripts(t distributionsR~R tdisttpkg_resources_distRotcommand((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytinstall_scriptsís     cCsÖtdƒddlm}ddlm}x¥|D]}x”t|ƒD]†}tjj|ƒddkro|}n|}|r¤tj j dj |ƒƒtj j ƒn|||ƒ|rDtj j dƒqDqDWq1WdS( Ns wheel converti(tbdist_wininst2wheel(t egg2wheelis.eggs{0}... sOK ( Rt wininst2wheelRŠR‹RR]R^tsplitextR!R"R#R tflush(t installerstdest_dirtverboseRŠR‹tpatt installertconv((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytconverts    c sdtjƒ‰ˆjddƒ}d„}|jdddƒ}|jd|ƒd„}|jddd ƒ}|jd dd ƒ|jd|ƒd „}|jd dtjƒ}|jd dd ƒ|jd|ƒd„}|jddtjƒ}|jd dd ƒ|jd|ƒd„} |jdddƒ} | jddddddƒ| jd dd ƒ| jd| ƒd„} |jdddƒ} | jdddddƒ| jddt d d!dd"ƒ| jd#dd d$d%d&dd'ƒ| jd(d)dd*ƒ| jd+d,dt d%d-d d!dd.ƒ| jd| ƒd/„} |jd0dd1ƒ}|jd2dddd3ƒ|jd| ƒd4„}|jd5dd6ƒ}|jd7dddd8ƒ|jd9ddt j j dd:ƒ|jd;d<d d!ƒ|jd|ƒd=„}|jd>dd?ƒ}|jd|ƒ‡fd@†}|jdddAƒ}|jd|ƒˆS(BNthelptcommandscSs tƒdS(N(R-(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytkeygen_fsR-sGenerate signing keytfunccSst|jƒdS(N(R=RB(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytsign_fsR=s Sign wheelRBs Wheel filecSst|jƒdS(N(RSRB(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytunsign_f$sRScSst|jƒdS(N(RXRB(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytverify_f*sRXcSst|j|jƒdS(N(RcRBRa(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytunpack_f0sRcs Unpack wheels--dests-dsDestination directorytdefaultR[cSs)t|j|j|j|j|jƒdS(N(RoRpRqRrReRs(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyt install_f8sRosInstall wheelsRptnargst*sRequirements to install.s--forcetactiont store_trues!Install incompatible wheel files.s --wheel-dirR.RaRrsDirectories containing wheels.s--requirements-files-rs*A file containing requirements to install.s--lists-lRssJList wheels which would be installed, but don't actually install anything.cSst|jƒdS(N(R‰R…(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytinstall_scripts_fNssinstall-scriptssInstall console_scriptsR…s2Regenerate console_scripts for these distributionscSst|j|j|jƒdS(N(R•RRR‘(R‚((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyt convert_fUsR•sConvert egg or wininst to wheelRsInstallers to converts --dest-dirs/Directory to store wheels (default %(default)s)s --verboses-vcSs(ddlm}tjjd|ƒdS(Ni(t __version__s wheel %s (tR¦R!R"R#(R‚R¦((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyt version_f^stversionsPrint version and exitcsˆjƒdS(N(t print_help(R‚(tp(s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pythelp_fdssShow this help( targparsetArgumentParsertadd_subparserst add_parsert set_defaultst add_argumentRSt__doc__RXtFalseR]R^Ri(tsR˜t keygen_parserRšt sign_parserR›t unsign_parserRœt verify_parserRt unpack_parserRŸtinstall_parserR¤tinstall_scripts_parserR¥tconvert_parserR¨tversion_parserR¬t help_parser((R«s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytparsersv          cCswtƒ}|jƒ}t|dƒs1|jƒnBy|j|ƒdSWn*tk rr}tjj|j dƒnXdS(NR™is i( RÀt parse_argsthasattrRªR™RR!RYR#tmessage(R«R‚te((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pytmainls    ($R³R­R:R?R]R!tglobRR§RRoRRtpathsRtutilRRRRR Rt ExceptionRRR-R´R=RSRXRctNoneR‰R•RÀRÅ(((s2/tmp/pip-build-0nEYGB/wheel/wheel/tool/__init__.pyts2     (       T   W