ó â\e[c@sjdZddlmZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z mZddlmZdd lmZmZmZmZmZd „Zd efd „ƒYZd „Zd„Zed„Zeed„Zd„Zd„Z dd„Z!ddeeed„Z d„Z#d„Z$d„Z%d„Z&dS(s Wheel command-line utility. iÿÿÿÿ(tprint_functionN(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 ((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytrequire_pkgresourcess t WheelErrorcBseZRS((t__name__t __module__(((s4/tmp/pip-install-0xiv62/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((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyR s  cCstddtjƒdS(Ns‚WARNING: The wheel signing and signature verification commands have been deprecated and will be removed before the v1.0.0 release.tfile(tprinttsyststderr(((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytwarn_signatures,s c Cstƒ|ƒ\}}tjƒ}|ƒjƒ}|jƒ}tt|jƒƒ}tt|jƒƒ}|j ƒ}|j d||ƒt dj |ƒƒt dj |ƒƒ|j d|ƒ} | |krÙtdƒ‚nt dj |ƒƒ|jd|ƒ|jd|ƒ|jƒdS(s#Generate a public/private key pair.twheels"Created Ed25519 keypair with vk={}sin {!r}s1Keyring is broken. Could not retrieve secret key.s,Trusting {} to sign and verify all packages.t+N(RRt get_ed25519lltloadtcrypto_sign_keypairRRtvktskRt set_passwordRRt get_passwordRt add_signerttrusttsave( RRRt ed25519lltwktkeypairR$R%tkrtsk2((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytkeygen1s$    cCs•tƒ|ƒ\}}tjƒ}t|dtƒ}|ƒjƒ}|jjdƒ}|j|ƒd} t dj || dƒƒ| d} |j ƒ} | j d| ƒ} |j tt| ƒƒtt| ƒƒƒ} |jd}|jd}||jjƒkrtd ƒ‚n|jj|ƒ}id tttj|ƒjƒƒƒd 6}tj|| ƒ}|jj|tj|d tƒƒ|jjƒd S(s Sign a wheeltappendRisSigning {} with {}iRs/RECORDs /RECORD.jwssWheel is already signed.ssha256=thasht sort_keysN(RRR!RtTrueR"tparsed_filenametgrouptsignersRRRR'tKeypairRR t distinfo_nametzipfiletnamelistRtreadRRthashlibtsha256tdigesttsigntwritestrtjsontdumpstclose(t wheelfiletreplaceRRRR+twfR,Rt sign_withR$R.R%R-t record_nametsig_namet record_datatpayloadtsig((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyR@Ls,     ,"cCsktƒt|dƒ}|jƒ}t|ƒoA|djjdƒsStdƒ‚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( RRtinfolisttlentfilenametendswithRtpopRD(REtvzftinfo((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytunsignks " cCsªtƒt|ƒ}|jd}y+tjt|jj|ƒjƒƒƒ}Wnt k rjt dƒ‚nXt j |ƒ}t ddtjƒt tj|ddƒƒ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.RtindentiN(RRR9RBtloadsRR:topenR<tKeyErrorRRtverifyRRRRC(RERGRJRMtverified((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyR[|s  + t.cCskt|ƒ}|jjdƒ}tjj||ƒ}td|dtjƒ|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: %sRN( RR5R6tostpathtjoinRRRR:t extractallRD(REtdestRGR^t destination((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytunpacks 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|r*tdƒn|r4dSxM| D]E} |rctdj| jƒƒq;n| jd |ƒ| jjƒq;WdS( 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 {}tforce(R_tgetenvtsplittpathsepR`tcurdirtlistdirRRRRat compatibleR1texistsRYtextendRRR tmaxRRQtinstallR:RD(t requirementstrequirements_filet wheel_dirsRgt list_filestdry_runt wheelpatht all_wheelstdtwRGRtfdt to_installtreqtmsgtmatches((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyRq¡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_distRqtcommand((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytinstall_scripts÷s     cCsÊtdƒddlm}ddlm}x™|D]‘}xˆt|ƒD]z}tjj|ƒddkro|}n|}|ržtdj |ƒƒt j j ƒn|||ƒ|rDtdƒqDqDWq1WdS( Ns wheel converti(tbdist_wininst2wheel(t egg2wheelis.eggs{}... tOK( Rt wininst2wheelRŒRRR_R`tsplitextRRRtstdouttflush(t installerstdest_dirtverboseRŒRtpatt installertconv((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytconvert s    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(R0(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytkeygen_f#sR0sGenerate signing keytfunccSst|jƒdS(N(R@RE(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytsign_f(sR@s Sign wheelREs Wheel filecSst|jƒdS(N(RVRE(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytunsign_f.sRVcSst|jƒdS(N(R[RE(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytverify_f4sR[cSst|j|jƒdS(N(ReRERc(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytunpack_f:sRes Unpack wheels--dests-dsDestination directorytdefaultR]cSs)t|j|j|j|j|jƒdS(N(RqRrRsRtRgRu(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyt install_fBsRqsInstall wheelsRrtnargst*sRequirements to install.s--forcetactiont store_trues!Install incompatible wheel files.s --wheel-dirR1RcRtsDirectories containing wheels.s--requirements-files-rs*A file containing requirements to install.s--lists-lRusJList wheels which would be installed, but don't actually install anything.cSst|jƒdS(N(R‹R‡(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytinstall_scripts_fXssinstall-scriptssInstall console_scriptsR‡s2Regenerate console_scripts for these distributionscSst|j|j|jƒdS(N(R™R“R”R•(R„((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyt convert_f_sR™sConvert egg or wininst to wheelR“sInstallers to converts --dest-dirs/Directory to store wheels (default %(default)s)s --verboses-vcSs"ddlm}td|ƒdS(Ni(t __version__swheel %s(tRªR(R„Rª((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyt version_fhstversionsPrint version and exitcsˆjƒdS(N(t print_help(R„(tp(s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pythelp_fnssShow this help( targparsetArgumentParsertadd_subparserst add_parsert set_defaultst add_argumentRVt__doc__R[tFalseR_R`Rk(tsRœt keygen_parserRžt sign_parserRŸt unsign_parserR t verify_parserR¡t unpack_parserR£tinstall_parserR¨tinstall_scripts_parserR©tconvert_parserR¬tversion_parserR°t help_parser((R¯s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytparsersv          cCsstƒ}|jƒ}t|dƒs1|jƒn>y|j|ƒdSWn&tk rn}t|dtjƒnXdS(NRiRi( RÄt parse_argsthasattrR®RRRRR(R¯R„te((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pytmainvs    ('R·t __future__RR±R=RBR_RtglobRR«RRqRRtpathsRtutilRRRR R Rt ExceptionRRRR0R¸R@RVR[RetNoneR‹R™RÄRÈ(((s4/tmp/pip-install-0xiv62/wheel/wheel/tool/__init__.pyts6     (        T   W