o ¯)»aœNã@sÌdZddlmZddlmZddlmZmZddlmZmZm Z m Z ddl m Z m Z ddlmZmZddlmZdd lmZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd lZdd l Z dd l!Z!dd l"Z"dd l#Z#dd l$Z$dd l%Z%dd l&Z&dd l'm(Z(m)Z)dd l*m+Z+dd l*m,Z,ddl-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6ddl/m7Z7m8Z8ddl9m:Z:ddl;mZ>m?Z?m@Z@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJdd l;Z;ejKde;jLdgd¢ZMdd„ZNdd„ZOdd„ZPdd„ZQd d!„ZRGd"d#„d#e,ƒZSd$d%„ZTd&d'„ZUd(d)„ZVd*d+„ZWd,d-„ZXGd.d/„d/eBƒZYGd0d1„d1eYƒZZej[ \d2d3¡d4krBeZZYd5d6„Z]d7d8„Z^d9d:„Z_d;d<„Z`did=d>„Zad?d@„ZbdAdB„ZcdCejdvrhecZendDdE„ZedjdGdH„ZfdIdJ„ZgdKdL„ZhdMdN„ZizddOlmjZkWnely“dPdQ„ZkYnwdRdS„ZjGdTdU„dUemƒZnen o¡ZpGdVdW„dWenƒZqGdXdY„dYƒZrGdZd[„d[erƒZsGd\d]„d]esƒZterjuZuerjvZvd^d_„Zwd`da„Zxdbe^fdcdd„Zydedf„ZzGdgdh„dhe+ƒZ{d S)ka0 Easy Install ------------ A tool for doing automatic download/extract/build of distutils-based Python packages. For detailed documentation, see the accompanying EasyInstall.txt file, or visit the `EasyInstall home page`__. __ https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html é)Úglob)Ú get_platform)Ú convert_pathÚ subst_vars)ÚDistutilsArgErrorÚDistutilsOptionErrorÚDistutilsErrorÚDistutilsPlatformError)ÚINSTALL_SCHEMESÚ SCHEME_KEYS)ÚlogÚdir_util)Ú first_line_re)Úfind_executableN)Úget_config_varsÚget_path)ÚSetuptoolsDeprecationWarning)ÚCommand)Ú run_setup)Úsetopt)Úunpack_archive)Ú PackageIndexÚparse_requirement_argÚ URL_SCHEME)Ú bdist_eggÚegg_info)ÚWheel)Ú yield_linesÚnormalize_pathÚresource_stringÚensure_directoryÚget_distributionÚfind_distributionsÚ EnvironmentÚ RequirementÚ DistributionÚ PathMetadataÚ EggMetadataÚ WorkingSetÚDistributionNotFoundÚVersionConflictÚ DEVELOP_DISTÚdefault)Úcategory)ÚsamefileÚ easy_installÚPthDistributionsÚextract_wininst_cfgÚget_exe_prefixescCst d¡dkS)NÚPé)ÚstructÚcalcsize©r7r7úR/opt/alt/python310/lib/python3.10/site-packages/setuptools/command/easy_install.pyÚis_64bitJór9cCsjtj |¡o tj |¡}ttjdƒo|}|rtj ||¡Stj tj |¡¡}tj tj |¡¡}||kS)z  Determine if two paths reference the same file. Augments os.path.samefile to work on Windows and suppresses errors if the path doesn't exist. r.)ÚosÚpathÚexistsÚhasattrr.ÚnormpathÚnormcase)Zp1Zp2Z both_existZ use_samefileZnorm_p1Znorm_p2r7r7r8r.Nsr.cCs | d¡S)NÚutf8)Úencode©Úsr7r7r8Ú _to_bytes^s rEcCs&z| d¡WdStyYdSw)NÚasciiTF)rBÚ UnicodeErrorrCr7r7r8Úisasciibs   ÿrHcCst |¡ ¡ dd¡S)NÚ z; )ÚtextwrapÚdedentÚstripÚreplace)Útextr7r7r8Ú _one_linerjsrOc@szeZdZdZdZdZdddddd d d d d ddddddddddddddejfgZgd¢Z ddiZ e Z dd „Z d!d"„Zd#d$„Zed%d&„ƒZd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„ZdŽd1d2„Zd3d4„Zd5d6„Zd7d8„Ze d9¡ ¡Ze d:¡ ¡Ze d;¡ ¡Z dd?„Z"d@dA„Z#dBdC„Z$dDdE„Z%dFdG„Z&e'j(dHdI„ƒZ)ddKdL„Z*ddMdN„Z+dOdP„Z, dŽdQdR„Z-dSdT„Z.dUdV„Z/dWdX„Z0ddYdZ„Z1ed[d\„ƒZ2d‘d_d`„Z3dadb„Z4dcdd„Z5dedf„Z6dgdh„Z7didj„Z8dkdl„Z9e dm¡ ¡Z:e dn¡Z;d’dpdq„Zdudv„Z?dwdx„Z@dydz„ZAd{d|„ZBd}d~„ZCdd€„ZDdd‚„ZEe dƒ¡ F¡ZGd„d…„ZHeIeId†d‡dˆd‰ZJeIdŠd‹dˆZKdŒd„ZLdS)“r/z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)úzip-okÚzzinstall package as a zipfile)ú multi-versionÚmz%make apps have to require() a version)ÚupgradeÚUz1force upgrade (searches PyPI for latest versions))z install-dir=Údzinstall package to DIR)z script-dir=rDzinstall scripts to DIR)úexclude-scriptsÚxzDon't install scripts)ú always-copyÚaz'Copy all needed packages to install dir)z index-url=Úiz base URL of Python Package Index)z find-links=Úfz(additional URL(s) to search for packages)zbuild-directory=Úbz/download/extract/build in DIR; keep the results)z optimize=ÚOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])zrecord=Nz3filename in which to record list of installed files)ú always-unzipÚZz*don't install as a zipfile, no matter what)z site-dirs=ÚSz)list of directories where .pth files work)ÚeditableÚez+Install specified packages in editable form)úno-depsÚNzdon't install dependencies)z allow-hosts=ÚHz$pattern(s) that hostnames must match)úlocal-snapshots-okÚlz(allow building eggs from local checkouts)ÚversionNz"print version information and exit)z no-find-linksNz9Don't load find-links defined in packages being installedÚuserNz!install in user site-package '%s') rPrRrWrTrYrbrdrgrirjr_rPcCs2t dt¡d|_d|_|_d|_|_|_d|_ d|_ d|_ d|_ d|_ |_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ t!j"rlt!j#|_$t!j%|_&nd|_$d|_&d|_'d|_(d|_)|_*d|_+i|_,d|_-|j.j/|_/|j. 0||j. 1d¡¡dS)NzVeasy_install command is deprecated. Use build and pip and other standards-based tools.rr/)2ÚwarningsÚwarnÚEasyInstallDeprecationWarningrjÚzip_okÚlocal_snapshots_okÚ install_dirÚ script_dirÚexclude_scriptsÚ index_urlÚ find_linksÚbuild_directoryÚargsÚoptimizeÚrecordrTÚ always_copyÚ multi_versionrbÚno_depsÚ allow_hostsÚrootÚprefixÚ no_reportriÚinstall_purelibÚinstall_platlibÚinstall_headersÚ install_libÚinstall_scriptsÚ install_dataÚ install_baseÚinstall_platbaseÚsiteÚENABLE_USER_SITEÚ USER_BASEÚinstall_userbaseÚ USER_SITEÚinstall_usersiteÚ no_find_linksÚ package_indexÚpth_fileÚalways_copy_fromÚ site_dirsÚinstalled_projectsZ_dry_runÚ distributionÚverboseZ_set_command_optionsÚget_option_dict©Úselfr7r7r8Úinitialize_options›sNý      ÿzeasy_install.initialize_optionscCs"dd„|Dƒ}tt|j|ƒƒdS)Ncss,|]}tj |¡stj |¡r|VqdS©N)r;r<r=Úislink)Ú.0Úfilenamer7r7r8Ú Ñs€ þ þ ÿz/easy_install.delete_blockers..)ÚlistÚmapÚ _delete_path)r˜ÚblockersZextant_blockersr7r7r8Údelete_blockersÐsÿzeasy_install.delete_blockerscCsJt d|¡|jr dStj |¡otj |¡ }|rtntj}||ƒdS)Nz Deleting %s) r ÚinfoÚdry_runr;r<Úisdirr›ÚrmtreeÚunlink)r˜r<Zis_treeZremoverr7r7r8r¡×s  zeasy_install._delete_pathcCs4djtjŽ}tdƒ}d}t|jditƒ¤Žƒtƒ‚)zT Render the Setuptools version and installation details, then exit. ú{}.{}Ú setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})Nr7)ÚformatÚsysÚ version_infor!ÚprintÚlocalsÚ SystemExit)ZverÚdistÚtmplr7r7r8Ú_render_versionàs zeasy_install._render_versionc Csl|jo| ¡tj ¡d}tddƒ\}}|j ¡|j ¡|j ¡||dd…|d|d||||t tddƒdœ |_ t j rK|j |j d <|j|j d <n|jrSt d ¡| ¡| ¡| ¡| d d dd¡|jdurp|j|_|jdurxd|_| dd¡| dd¡|jr’|jr’|j|_|j|_| dd¡tttjƒ}tƒ|_ |j!durØdd„|j! d¡Dƒ}|D]#}t"j #|¡sÃt d|¡q´t|ƒ|vrÏt$|dƒ‚|j  %t|ƒ¡q´|j&sß| '¡|j(pãd|_(|j dd…|_)|jt|jƒfD]}||j)vr|j) *d|¡qõ|j+durdd„|j+ d¡Dƒ}ndg}|j,dur+|j-|j(|j)|d|_,t.|j)tjƒ|_/|j0durHt1|j0t2ƒrG|j0 ¡|_0ng|_0|j3rY|j, 4|j)tj¡|jsd|j, 5|j0¡| dd ¡t1|j6t7ƒszt7|j6ƒ|_6d|j6kr†dks‰t8‚t8‚Wnt8yœ} zt$d!ƒ| ‚d} ~ ww|j&r©|j9s©t:d"ƒ‚|j;s±t:d#ƒ‚g|_-sÿz1easy_install.finalize_options..ú,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|]}| ¡‘qSr7)rLr¾r7r7r8r¿CóÚ*)Z search_pathÚhosts)rwrwz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rir³r¬Úsplitrr”Zget_nameZ get_versionZ get_fullnameÚgetattrÚ config_varsrˆr‰r‹rrjr rlÚ_fix_install_dir_for_user_siteÚexpand_basedirsÚ expand_dirsÚ_expandrqrprŽZset_undefined_optionsr€r„r rr<Ú get_site_dirsÚ all_site_dirsr’r;r¦rÚappendrbÚcheck_site_dirrsÚ shadow_pathÚinsertr|rÚ create_indexr#Ú local_indexrtÚ isinstanceÚstrroZscan_egg_linksÚadd_find_linksrwÚintÚ ValueErrorrurrvÚoutputs) r˜r¹r~r´r?r’rVZ path_itemrÃrcr7r7r8Úfinalize_optionsësÖ €  ô  þ  ÿÿ     þ  ÿ  €   ÿ  €  ÿÿÿþ€ÿÿÿ zeasy_install.finalize_optionscCs\|jrtjsdS| ¡|jdurd}t|ƒ‚|j|_|_tj   dd¡d}|  |¡dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedÚposixZunixZ_user) rjrˆr‰Úcreate_home_pathr‹r r†r‡r;ÚnamerMÚ select_scheme)r˜ÚmsgZ scheme_namer7r7r8rÇjs  z+easy_install._fix_install_dir_for_user_sitecCsX|D]'}t||ƒ}|dur)tjdkstjdkrtj |¡}t||jƒ}t|||ƒqdS)NrÚÚnt)rÅr;rÜr<r½rrÆÚsetattr)r˜ÚattrsÚattrÚvalr7r7r8Ú _expand_attrsys    €úzeasy_install._expand_attrscCs| gd¢¡dS)zNCalls `os.path.expanduser` on install_base, install_platbase and root.)r†r‡r}N©rär—r7r7r8rÈ‚szeasy_install.expand_basedirscCsgd¢}| |¡dS)z+Calls `os.path.expanduser` on install dirs.)r€rrƒr‚r„r…Nrå)r˜Údirsr7r7r8rɇszeasy_install.expand_dirsc Csà|r | dtj¡|j|jjkrt |j¡zQ|jD] }| ||j ¡q|j rZ|j }|j rFt |j ƒ}t t |ƒƒD] }|||d…||<q9ddlm}| |j|j |fd|j ¡| ¡Wt |jj¡dSt |jj¡w)NzXWARNING: The easy_install command is deprecated and will be removed in a future version.r)Ú file_utilz'writing list of installed files to '%s')Zannouncer ZWARNr•r”Ú set_verbosityrvr/r{rxrØr}ÚlenÚrangeÚ distutilsrçÚexecuteZ write_fileÚwarn_deprecated_options)r˜Zshow_deprecationÚspecrØZroot_lenZcounterrçr7r7r8Úrun“s2ý     ÿþ "zeasy_install.runcCsBzt ¡}Wntyt dtj¡}Ynwtj |j d|¡S)zÈReturn a pseudo-tempname base in the install directory. This code is intentionally naive; if a malicious party can write to the target directory you're already in deep doodoo. rztest-easy-install-%s) r;ÚgetpidÚ ExceptionÚrandomZrandintr¬Úmaxsizer<Újoinrp)r˜Úpidr7r7r8Úpseudo_tempname°s   ÿzeasy_install.pseudo_tempnamecCódSršr7r—r7r7r8rí»óz$easy_install.warn_deprecated_optionsc CsBt|jƒ}tj |d¡}tj |¡s)zt |¡Wnttfy(|  ¡Ynw||j v}|s8|j s8|  ¡}n1|  ¡d}tj |¡}z|rLt |¡t|dƒ ¡t |¡Wnttfyh|  ¡Ynw|s~|j s~tj dd¡}t |j|j|¡|r|jdurŒt||j ƒ|_nd|_|j rœtj |¡sœd|_||_dS)z;Verify that self.install_dir is .pth-capable dir, if neededúeasy-install.pthz .write-testÚwÚ PYTHONPATHr¸N)rrpr;r<rôr=ÚmakedirsÚOSErrorÚIOErrorÚcant_write_to_targetrÌrzÚcheck_pth_processingrör¨ÚopenÚcloseÚenvironÚgetr rlÚ_easy_install__no_default_msgrr0)r˜ÚinstdirrZ is_site_dirZtestfileZ test_existsZ pythonpathr7r7r8rξs@   ÿ       ÿ  € zeasy_install.check_site_diraS can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: %s The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s zÀ This directory does not currently exist. Please create it and try again, or choose a different installation directory (using the -d or --install-dir option). a¶ Perhaps your account does not have write access to this directory? If the installation directory is a system-owned directory, you may need to sign in as the administrator or "root" account. If you do not have administrative access to this machine, you may wish to choose a different installation directory, preferably one that is listed in your PYTHONPATH environment variable. For information on other options, you may wish to consult the documentation at: https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html Please make the appropriate changes for your system and try again. cCsR|jt ¡d|jf}tj |j¡s|d|j7}t |ƒ‚|d|j7}t |ƒ‚)NérI) Ú_easy_install__cant_write_msgr¬Úexc_inforpr;r<r=Ú_easy_install__not_exists_idÚ_easy_install__access_msgr)r˜rÞr7r7r8rÿs ÿz!easy_install.cant_write_to_targetc Cs|j}t d|¡| ¡d}|d}tj |¡}tdƒd}z|r't |¡tj  |¡}tj |ddt |dƒ}Wnt t fyI| ¡Yn³wz“| |jditƒ¤Ž¡| ¡d }tj}tjd kr„tj |¡\}} tj |d ¡} |  ¡d kotj | ¡} | r„| }d dlm} | |dddgd ƒtj |¡rÀt d|¡W|r¦| ¡tj |¡r±t |¡tj |¡r¾t |¡dSdSW|rÇ| ¡tj |¡rÒt |¡tj |¡rÝt |¡n|rä| ¡tj |¡rït |¡tj |¡rût |¡ww|jst d|¡dS)z@Empirically verify whether .pth files are supported in inst. dirz Checking .pth file support in %sú.pthz.okzz import os f = open({ok_file!r}, 'w') f.write('OK') f.close() rIT)Úexist_okrúNrßú pythonw.exeú python.exer)Úspawnz-Ez-cÚpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesFr7)rpr r¤rör;r<r=rOr¨ÚdirnamerürrýrþrÿÚwriter«r¯rr¬Ú executablerÜrÄrôÚlowerÚdistutils.spawnrrzrl) r˜rrZok_fileZ ok_existsr²rr\rÚbasenameZaltZuse_altrr7r7r8rs~   û   ÿ   þ  þ   ÿõ    €û    ÿ z!easy_install.check_pth_processingc CsV|js$| d¡r$| d¡D]}| d|¡rq | ||| d|¡¡q | |¡dS)z=Write all the scripts for `dist`, unless scripts are excludedÚscriptszscripts/N)rrZmetadata_isdirZmetadata_listdirÚinstall_scriptZ get_metadataÚinstall_wrapper_scripts)r˜r±Ú script_namer7r7r8Úinstall_egg_scriptsSs þz easy_install.install_egg_scriptscCsVtj |¡r#t |¡D]\}}}|D] }|j tj ||¡¡qq dS|j |¡dSrš)r;r<r¦ÚwalkrØrÍrô)r˜r<ÚbaseræÚfilesrr7r7r8Ú add_outputas ÿÿzeasy_install.add_outputcCs|jr td|fƒ‚dS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rbr©r˜rîr7r7r8Ú not_editableisþÿÿzeasy_install.not_editablecCs<|jsdStj tj |j|j¡¡rtd|j|jfƒ‚dS)Nz2%r already exists in %s; can't do a checkout there)rbr;r<r=rôruÚkeyrr!r7r7r8Úcheck_editableqs ÿÿÿzeasy_install.check_editablec csTtjdd}zt|ƒVWtj |¡ot|ƒdSdStj |¡o(t|ƒww)Nz easy_install-)r~)ÚtempfileÚmkdtemprÔr;r<r=r§)r˜Útmpdirr7r7r8Ú_tmpdir{s €  8zeasy_install._tmpdirFc CsB| ¡“}t|tƒsIt|ƒr*| |¡|j ||¡}| d|||d¡WdƒStj   |¡rE| |¡| d|||d¡WdƒSt |ƒ}|  |¡|j  |||j|j|j |j¡}|durqd|}|jrm|d7}t|ƒ‚|jtkr‡| |||d¡|WdƒS| ||j||¡WdƒS1sšwYdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)ÚUsing)r(rÓr$rr"rÚdownloadÚ install_itemr;r<r=rr$Zfetch_distributionrTrbryrÒrZ precedencer+Úprocess_distributionÚlocation)r˜rîÚdepsr'Údlr±rÞr7r7r8r/„s8   ú  õ   þ ä$âzeasy_install.easy_installcCs |p|j}|ptj |¡|k}|p| d¡ }|p*|jduo*tj t|ƒ¡t|jƒk}|rA|sA|j|jD] }|j |kr>qAq5d}t   dtj  |¡¡|ra|  |||¡}|D] }| |||¡qVn| |¡g}| ||d|d¡|dur‚|D] }||vr|SqwdSdS)Nú.eggTz Processing %srr))ryr;r<rÚendswithr‘rrÒÚ project_namer-r r¤rÚ install_eggsr,Úegg_distribution)r˜rîr*r'r.Zinstall_neededr±Zdistsr7r7r8r+¥s<  ÿþ ÿÿ ÿþzeasy_install.install_itemcCs<t|}tD]}d|}t||ƒdurt||||ƒqdS)z=Sets the install directories by applying the install schemes.Zinstall_N)r r rÅrà)r˜rÜÚschemer#Úattrnamer7r7r8rÝÉs€ýzeasy_install.select_schemec Gsš| |¡|j |¡||j|jvr|j |¡|j |¡| |¡||j|j<t  |j ||g|¢RŽ¡|  d¡rH|j sH|j  | d¡¡|sO|jsOdS|dura|j|jkrat d|¡dS|dusi||vrs| ¡}tt|ƒƒ}t  d|¡ztgƒ |g|j|j¡}Wn%tyš}ztt|ƒƒ|‚d}~wty¬}zt| ¡ƒ|‚d}~ww|js³|jrÅ|D]}|j|jvrÄ| | ¡¡qµt  d|¡dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)Ú update_pthrÚaddrÒr#Úremoverr“r r¤Úinstallation_reportÚ has_metadatarŽrÕZget_metadata_linesryrlÚas_requirementr$rÔr(Úresolver/r)rr*Úreportr‘)r˜Z requirementr±r.r¤ZdistreqZdistrosrcr7r7r8r,ÓsP       ÿÿ     ÿ€€ÿ  €z!easy_install.process_distributioncCs2|jdur |j S| d¡rdS| d¡sdSdS)Nz not-zip-safeTzzip-safeF)rnr;©r˜r±r7r7r8Ú should_unzipüs   zeasy_install.should_unzipcCs¶tj |j|j¡}tj |¡rd}t ||j|j|¡|Stj |¡r&|}n)tj  |¡|kr3t  |¡t  |¡}t |ƒdkrOtj ||d¡}tj |¡rO|}t |ƒt ||¡|S)Nz<%r already exists in %s; build directory %s will not be keptrr)r;r<rôrur#r=r rlr¦rr¨Úlistdirrér ÚshutilÚmove)r˜rîÚ dist_filenameÚ setup_baseÚdstrÞÚcontentsr7r7r8Ú maybe_moves$ ÿ      zeasy_install.maybe_movecCs,|jrdSt ¡ |¡D]}|j|Žq dSrš)rrÚ ScriptWriterÚbestÚget_argsÚ write_script)r˜r±rvr7r7r8rs  ÿz$easy_install.install_wrapper_scriptscCsNt| ¡ƒ}t||ƒ}|r| |¡tƒ}t |¡|}| |t|ƒd¡dS)z/Generate a legacy script wrapper and install itr]N) rÔr<Úis_python_scriptÚ_load_templater¯rIÚ get_headerrLrE)r˜r±rÚ script_textÚdev_pathrîZ is_scriptÚbodyr7r7r8r"s  zeasy_install.install_scriptcCs(d}|r | dd¡}td|ƒ}| d¡S)z‰ There are a couple of template scripts in the package. This function loads one of them and prepares it for use. z script.tmplz.tmplz (dev).tmplrªúutf-8)rMrÚdecode)rQrÜZ raw_bytesr7r7r8rN,s    zeasy_install._load_templateÚtr7csºˆ ‡fdd„|Dƒ¡t d|ˆj¡tj ˆj|¡}ˆ |¡ˆjr&dSt ƒ}t |ƒtj  |¡r8t  |¡t |d|ƒ }| |¡Wdƒn1sOwYt|d|ƒdS)z1Write an executable file to the scripts directorycsg|] }tj ˆj|¡‘qSr7)r;r<rôrq©rœrXr—r7r8r¿>óz-easy_install.write_script..zInstalling %s script to %sNrúiÿ)r£r r¤rqr;r<rôr r¥Ú current_umaskr r=r¨rrÚchmod)r˜rrGÚmoder¢ÚtargetÚmaskr\r7r—r8rL;s ÿ    ÿzeasy_install.write_scriptc CsH|j|j|jdœ}z || ¡dd…}Wn tyYnw|||ƒgS|}tj |¡r:| d¡s:t |||j ƒn tj  |¡rFtj  |¡}|  |¡rY|jrY|durY| |||¡}tj |d¡}tj |¡sttj |dd¡ƒ}|s|tdtj  |¡ƒ‚t|ƒdkrŒtdtj  |¡ƒ‚|d }|jržt | ||¡¡gS| ||¡S) N)r0ú.exez.whléüÿÿÿú.pyzsetup.pyrÂz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)Ú install_eggÚ install_exeÚ install_wheelrÚKeyErrorr;r<Úisfiler1rÚunpack_progressr¦ÚabspathÚ startswithrurHrôr=rrrérbr r¤Úreport_editableÚbuild_and_install) r˜rîrDr'Z installer_mapZ install_distrEÚ setup_scriptZsetupsr7r7r8r3OsVýÿ ÿ    ÿÿ  ÿÿ  ÿÿ zeasy_install.install_eggscCs>tj |¡rt|tj |d¡ƒ}ntt |¡ƒ}tj ||dS)NúEGG-INFO)Úmetadata) r;r<r¦r&rôr'Ú zipimportÚ zipimporterr%Z from_filename)r˜Úegg_pathrlr7r7r8r4‚s  ÿzeasy_install.egg_distributionc Cs‚tj |jtj |¡¡}tj |¡}|jst|ƒ| |¡}t ||ƒs·tj  |¡r8tj  |¡s8t j ||jdntj |¡rI| tj|fd|¡z_d}tj  |¡re| |¡r^tjd}}qŠtjd}}n%| |¡rv| |¡|jd}}nd}| |¡r„tjd}}ntjd}}| |||f|dtj |¡tj |¡f¡t||d Wnty¶t|dd ‚w| |¡| |¡S) N©r¥ú Removing FZMovingZCopyingZ ExtractingTz %s to %s©Úfix_zipimporter_caches)r;r<rôrprrfr¥r r4r.r¦r›r Ú remove_treer=rìr¨rgrBrCZcopytreer@ZmkpathÚunpack_and_compileZcopy2rÚupdate_dist_cachesrñr )r˜ror'Ú destinationr±Znew_dist_is_zippedr\rSr7r7r8r`‹s` þ    ý        þý þ  þ  zeasy_install.install_eggc sNt|ƒ}|durtd|ƒ‚td| dd¡| dd¡tƒd}tj || ¡d¡}||_ |d}tj |d¡}tj |d ¡}t |ƒt ||ƒ|_ |  ||¡tj |¡s€t|d ƒ} |  d ¡| d¡D]\} } | d kr{|  d |  dd¡ ¡| f¡qd|  ¡tj |d¡‰| ‡fdd„t |¡Dƒ¡tj|||j|jd| ||¡S)Nz(%s is not a valid distutils Windows .exerlrÜri)r2riÚplatformr0z.tmprkúPKG-INFOrúzMetadata-Version: 1.0 Útarget_versionz%s: %s Ú_ú-rcsg|] }tj ˆ|d¡‘qS)r)r;r<rô)rœrv©rqr7r8r¿ãsÿÿz,easy_install.install_exe..)r•r¥)r1rr%rrr;r<rôÚegg_namer-r r&Z _providerÚ exe_to_eggr=rrÚitemsrMÚtitlerr£rIrKrZ make_zipfiler•r¥r`) r˜rDr'Úcfgr±roÚegg_tmpZ _egg_infoZpkg_infr\ÚkÚvr7r}r8raÁsDÿ ý     €þ ÿ zeasy_install.install_exec s8t|ƒ‰g‰g‰i‰‡‡‡‡‡fdd„}t|ˆ|ƒg}ˆD]7}| ¡ d¡rU| d¡}|d}t |d¡d|d<tjj ˆg|¢RŽ}ˆ  |¡|  |¡t  ||¡q|  ˆ¡t  tj  ˆd¡t ˆ|¡¡dD]-} tƒ| r™tj  ˆd| d ¡} tj | ¡s™t| d ƒ} |  d   tƒ| ¡d ¡|  ¡qld S) z;Extract a bdist_wininst to the directories an egg would usecs| ¡}ˆD]l\}}| |¡rr||t|ƒd…}| d¡}tjjˆg|¢RŽ}| ¡}| d¡s6| d¡rTt  |d¡|d<dˆtj  |d¡d<ˆ  |¡|S| d¡rn|dkrndˆtj  |d¡d<ˆ  |¡|Sq| d ¡s~t   d |¡dS) Nú/ú.pydú.dlléÿÿÿÿrrr_úSCRIPTS/r zWARNING: can't process %s)rrgrérÄr;r<rôr1rÚ strip_moduleÚsplitextrÍr rl)ÚsrcrFrDÚoldÚnewÚpartsr/©rƒÚ native_libsÚprefixesÚ to_compileÚ top_levelr7r8Úprocess÷s(    ý ô z(easy_install.exe_to_egg..processr‡r†r‰r_rk)r•r’z.txtrúrIN)r2rrr1rÄrr‹r;r<rôrÍZ write_stubÚ byte_compileZwrite_safety_flagZ analyze_eggr¯r=rrr) r˜rDrƒr–ZstubsÚresrZresourceZpyfilerÜZtxtr\r7r‘r8rïs>     €   þ   €úzeasy_install.exe_to_eggc Csìt|ƒ}| ¡s J‚tj |j| ¡¡}tj |¡}|js!t |ƒtj  |¡r6tj  |¡s6t j ||jdntj |¡rG| tj|fd|¡z| |j|fdtj |¡tj |¡f¡Wt|ddnt|ddw| |¡| |¡S)NrprqzInstalling %s to %sFrr)rZ is_compatibler;r<rôrpr~rfr¥r r¦r›r rtr=rìr¨Zinstall_as_eggrrrvr r4)r˜Z wheel_pathr'Zwheelrwr7r7r8rb$s4   ý  þý  zeasy_install.install_wheela( Because this distribution was installed --multi-version, before you can import modules from this package in an application, you will need to 'import pkg_resources' and then use a 'require()' call similar to one of these examples, in order to select the desired version: pkg_resources.require("%(name)s") # latest installed version pkg_resources.require("%(name)s==%(version)s") # this exact version pkg_resources.require("%(name)s>=%(version)s") # this version or higher zõ Note also that the installation directory must be on sys.path at runtime for this to work. (e.g. by being the application's script directory, by being on PYTHONPATH, or by being added to sys.path by your code.) Ú Installedc Cs^d}|jr|js|d|j7}|jtttjƒvr|d|j7}|j }|j }|j }d}|t ƒS)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srIr¸) rzrÚ_easy_install__mv_warningrpr rr¬r<Ú_easy_install__id_warningr-r2rir¯) r˜Zreqr±ZwhatrÞZegglocrÜriZextrasr7r7r8r:Rs  z easy_install.installation_reportaR Extracted editable version of %(spec)s to %(dirname)s If it uses setuptools in its setup script, you can activate it in "development" mode by going to that directory and running:: %(python)s setup.py develop See the setuptools documentation for the "develop" command for more info. cCs"tj |¡}tj}d|jtƒS)NrI)r;r<rr¬rÚ_easy_install__editable_msgr¯)r˜rîrjrÚpythonr7r7r8rhks zeasy_install.report_editablec CsÚtj dt¡tj dt¡t|ƒ}|jdkr'd|jd}| dd|¡n |jdkr2| dd¡|jr;| dd ¡t   d |t |ƒdd…d   |¡¡zt ||ƒWdStyl}z td |jdfƒ|‚d}~ww) Nzdistutils.command.bdist_eggzdistutils.command.egg_infor¶r…rrr|z-qz-nz Running %s %sú zSetup script exited with %s)r¬ÚmodulesÚ setdefaultrrrŸr•rÐr¥r r¤rérôrr°rrv)r˜rjrErvr…r7r7r8rps.    ÿÿþ€ÿzeasy_install.run_setupc CsÊddg}tjdtj |¡d}zJ| tj |¡¡| |¡| |||¡t|gƒ}g}|D]}||D] }| |  |j |¡¡q4q.|sM|j sMt   d|¡|Wt|ƒt  |j¡St|ƒt  |j¡w)Nrz --dist-dirz egg-dist-tmp-)r~Údirz+No eggs found in %s (setup script problem?))r%r&r;r<rÚ_set_fetcher_optionsrÍrr#r`r-r¥r rlr§rèr•) r˜rjrErvZdist_dirZall_eggsZeggsr#r±r7r7r8ri†s. ÿ   ÿ ÿÿzeasy_install.build_and_installc Csh|j d¡ ¡}d}i}| ¡D]\}}||vrq|d||<qt|d}tj |d¡}t  ||¡dS)a When easy_install is about to run bdist_egg on a source dist, that source dist might have 'setup_requires' directives, requiring additional fetching. Ensure the fetcher options given to easy_install are available to that command as well. r/)rtr’rsrwr|r)r/z setup.cfgN) r”r–Úcopyr€Údictr;r<rôrZ edit_config) r˜rZei_optsZfetch_directivesZ fetch_optionsr#rãZsettingsZ cfg_filenamer7r7r8r¢žs  z!easy_install._set_fetcher_optionscCsJ|jdurdS|j|jD]%}|js|j|jkrq t d|¡|j |¡|j|jvr2|j |j¡q |js]|j|jjvrDt d|¡nt d|¡|j  |¡|j|jvr]|j  |j¡|j rbdS|j  ¡|jdkrndSt j |jd¡}t j |¡rt  |¡t|dƒ}| |j |j¡d¡WdƒdS1sžwYdS)Nz&Removing %s from easy-install.pth filez4%s is already the active version in easy-install.pthz"Adding %s to easy-install.pth filerªúsetuptools.pthÚwtrI)rr#rzr-r r¤r9rÏÚpathsr8rÍr¥Úsaver;r<rôrpr›r¨rrÚ make_relative)r˜r±rVrr\r7r7r8r7µs>    €þ        "ÿzeasy_install.update_pthcCst d||¡|S)NzUnpacking %s to %s)r Údebug)r˜rrFr7r7r8reÞszeasy_install.unpack_progresscshg‰g‰‡‡‡fdd„}t|||ƒˆ ˆ¡ˆjs0ˆD]}t |¡tjdBd@}t||ƒqdSdS)NcsZ| d¡r| d¡sˆ |¡n| d¡s| d¡rˆ |¡ˆ ||¡ˆj r+|p,dS)Nr_ú EGG-INFO/rˆz.so)r1rgrÍrer¥)rrF©r˜Zto_chmodr”r7r8Úpfçs    z+easy_install.unpack_and_compile..pfimií)rr—r¥r;ÚstatÚST_MODErY)r˜rorwr­r\rZr7r¬r8ruãs   ýzeasy_install.unpack_and_compilec Cs†tjrdSddlm}z0t |jd¡||dd|jd|jr3|||jd|jdWt |j¡dSWt |j¡dSt |j¡w)Nr)r—r)rwÚforcer¥) r¬Údont_write_bytecodeÚdistutils.utilr—r rèr•r¥rw)r˜r”r—r7r7r8r—ös þúzeasy_install.byte_compilea” bad install directory or PYTHONPATH You are attempting to install a package to a directory that is not on PYTHONPATH and which Python does not read ".pth" files from. The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was: %s and your PYTHONPATH environment variable currently contains: %r Here are some of your options for correcting the problem: * You can choose a different installation directory, i.e., one that is on PYTHONPATH or supports .pth files * You can add the installation directory to the PYTHONPATH environment variable. (It must then also be on PYTHONPATH whenever you run Python and want to use the package(s) you are installing.) * You can set up the installation directory to support ".pth" files by using one of the approaches described here: https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html#custom-installation-locations Please make the appropriate changes for your system and try again. cCsb|jsdSttj d¡ƒ}|j ¡D]\}}| |¡r.tj |¡s.|  d|¡t  |d¡qdS)zCreate directories under ~.Nú~zos.makedirs('%s', 0o700)iÀ) rjrr;r<r½rÆr€rgr¦Z debug_printrü)r˜ÚhomerÜr<r7r7r8rÛ)s €ýzeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/binr»©rÚz$base/Lib/site-packagesz $base/ScriptscGs¼| d¡j}|jr2| ¡}|j|d<|j tj|j¡}|  ¡D]\}}t ||dƒdur1t |||ƒqddl m }|D]!}t ||ƒ}|dur[|||ƒ}tjdkrUtj |¡}t |||ƒq:dS)Nr¼rr)rrÚ)Zget_finalized_commandrÆr~r£r rr;rÜÚDEFAULT_SCHEMEr€rÅràr²rr<r½)r˜rárÆr5rârãrr7r7r8rÊ?s&   €      €úzeasy_install._expand)T)Frš)rUr7)r™)MÚ__name__Ú __module__Ú __qualname__Ú__doc__Ú descriptionZcommand_consumes_argumentsrˆrŒZ user_optionsZboolean_optionsZ negative_optrrÑr™r£r¡Ú staticmethodr³rÙrÇrärÈrÉrïrörírÎrJrKÚlstriprr r rÿrrr r"r$Ú contextlibÚcontextmanagerr(r/r+rÝr,r@rHrrrNrLr3r4r`rarrbršr›r:rœrhrrir¢r7rerur—rLrrÛr¤r r¶rÊr7r7r7r8r/nsÜä5     - ôüò ;   !$ ÿ)    3 6.5 ÷  ÷ )â  þÿþ r/cCs tj dd¡ tj¡}td|ƒS)Nrûr¸)r;rrrÄÚpathsepÚfilter)r€r7r7r8Ú _pythonpathVs rÂc sŠg‰ˆ tƒ¡tjg}tjtjkr| tj¡|D]h}|sqtjdvr0ˆ tj  |dd¡¡n+tj dkrNˆ tj  |ddj tj Žd¡tj  |dd¡g¡n ˆ |tj  |dd¡g¡tjdkraqd |vrfqtj  d ¡}|soqtj  |d d d j tj Žd¡}ˆ |¡qtdƒtdƒf}ˆ ‡fdd„|Dƒ¡tjr ˆ tj¡t t¡ˆ t ¡¡Wdƒn1s·wYtttˆƒƒ‰ˆS)z& Return a list of 'site' dirs )Zos2emxZriscosZLibz site-packagesr†Úlibz python{}.{}z site-pythonÚdarwinzPython.frameworkÚHOMEÚLibraryÚPythonr©ZpurelibZplatlibc3s|] }|ˆvr|VqdSršr7r¾©Úsitedirsr7r8rž”s€z get_site_dirs..N)ÚextendrÂr¬r~r´rÍrxr;r<rôÚsepr«r­rrrrˆr‰rŒr¾ÚsuppressÚAttributeErrorÚgetsitepackagesrŸr r)r“r~r´Zhome_spZ lib_pathsr7rÈr8rË[s`      üù þ   û   ÿrËccsèi}|D]l}t|ƒ}||vrqd||<tj |¡sqt |¡}||fV|D]I}| d¡s/q'|dvr4q'ttj ||¡ƒ}tt |ƒƒ}|  ¡|D]&}|  d¡rQqIt|  ¡ƒ}||vr\qId||<tj |¡sgqI|t |¡fVqIq'qdS)zBYield sys.path directories that might contain "old-style" packagesrr )rùr¥ÚimportN) rr;r<r¦rAr1rrôrŸrrrgÚrstrip)ZinputsÚseenrrrÜr\ÚlinesÚliner7r7r8Ú expand_paths¡s@€        ôòôrÔc CsTt|dƒ}zŸt |¡}|durW| ¡dS|d|d|d}|dkr-W| ¡dS| |d¡t d| d¡¡\}}}|dvrKW| ¡dS| |d|¡d d d œ}t  |¡}z| |¡} |   d d ¡d } |   t   ¡¡} | t | ¡¡WntjyŒYW| ¡dSw| d¡r—| d¡sžW| ¡dS|W| ¡S| ¡w)znExtract configuration data from a bdist_wininst .exe Returns a configparser.RawConfigParser, or None ÚrbNé ééé zegg path translations for a given .exe file))zPURELIB/r¸)zPLATLIB/pywin32_system32r¸)zPLATLIB/r¸)rŠzEGG-INFO/scripts/)zDATA/lib/site-packagesr¸r†rµr¶ryrz .egg-inforNr«r z -nspkg.pth)ZPURELIBZPLATLIBú\rÏz%s/%s/r¸cSsg|] \}}| ¡|f‘qSr7)r)rœrXÚyr7r7r8r¿rWz$get_exe_prefixes..)rÛZZipFileZinfolistrrÄrér1rÐrôÚupperrÞrTrrLrMrgrÍrÚsortÚreverse)Z exe_filenamer“rQr¤rÜrrGZpthr7r7r8r2øs4      €r2c@sReZdZdZdZddd„Zdd„Zdd „Zed d „ƒZ d d „Z dd„Z dd„Z dS)r0z)A .pth file with Distribution paths in itFr7cCsl||_ttt|ƒƒ|_ttj |j¡ƒ|_|  ¡t   |gdd¡t |j ƒD] }tt|jt|dƒƒƒq&dS)NT)rrŸr rrÉr;r<rÚbasedirÚ_loadr#Ú__init__rr§r8r")r˜rrÉr<r7r7r8rí"sÿzPthDistributions.__init__cCsg|_d}t |j¡}tj |j¡ret|jdƒ}|D]F}|  d¡r$d}q|  ¡}|j  |¡|  ¡r9|  ¡  d¡r:qt tj |j|¡ƒ}|jd<tj |¡rS||vr\|j ¡d|_qd||<q| ¡|jrm|smd|_|jrˆ|jd  ¡sŒ|j ¡|jrŠ|jd  ¡rwdSdSdSdS)NFZrtrÏTú#r‰r)r§r¤ÚfromkeysrÉr;r<rdrrrgrÐrÍrLrrôrër=ÚpopÚdirtyr)r˜Z saw_importrÑr\rÓr<r7r7r8rì+s6    ÿ    $ÿzPthDistributions._loadcCsÊ|jsdStt|j|jƒƒ}|rLt d|j¡| |¡}d  |¡d}t j   |j¡r0t   |j¡t|jdƒ }| |¡Wdƒn1sFwYnt j  |j¡r`t d|j¡t   |j¡d|_dS)z$Write changed .pth file back to diskNz Saving %srIr¦zDeleting empty %sF)rñrŸr r©r§r rªrÚ _wrap_linesrôr;r<r›r¨rrr=)r˜Z rel_pathsrÒÚdatar\r7r7r8r¨Js"   ÿ€  zPthDistributions.savecCó|Sršr7)rÒr7r7r8rò`szPthDistributions._wrap_linescCsN|j|jvo|j|jvp|jt ¡k}|r|j |j¡d|_t ||¡dS)z"Add `dist` to the distribution mapTN) r-r§rÉr;ÚgetcwdrÍrñr#r8)r˜r±Únew_pathr7r7r8r8ds   üzPthDistributions.addcCs<|j|jvr|j |j¡d|_|j|jvst ||¡dS)z'Remove `dist` from the distribution mapTN)r-r§r9rñr#r?r7r7r8r9rs  þzPthDistributions.removecCs–tj t|ƒ¡\}}t|jƒ}|g}tjdkrdptj}t|ƒ|krI||jkr6| tj ¡|  ¡|  |¡Stj |¡\}}| |¡t|ƒ|ks"|S)Nr†) r;r<rÄrrérëÚaltseprËrÍÚcurdirrêrô)r˜r<ZnpathZlastZbaselenrrËr7r7r8r©ys       úzPthDistributions.make_relativeN)r7) r·r¸r¹rºrñrírìr¨r¼ròr8r9r©r7r7r7r8r0s    r0c@s(eZdZedd„ƒZedƒZedƒZdS)ÚRewritePthDistributionsccs&|jV|D]}|Vq|jVdSrš)ÚpreludeÚpostlude)ÚclsrÒrÓr7r7r8ròŠs € z#RewritePthDistributions._wrap_linesz? import sys sys.__plen = len(sys.path) zÐ import sys new = sys.path[sys.__plen:] del sys.path[sys.__plen:] p = getattr(sys, '__egginsert', 0) sys.path[p:p] = new sys.__egginsert = p + len(new) N)r·r¸r¹Ú classmethodròrOrúrûr7r7r7r8rù‰s   rùZSETUPTOOLS_SYS_PATH_TECHNIQUEÚrawZrewritecCs ttjtƒrtSt tj ¡¡S)z_ Return a regular expression based on first_line_re suitable for matching strings. )rÓrÚpatternrÔÚreÚcompilerTr7r7r7r8Ú_first_line_re£s rcCsX|tjtjfvrtjdkrt|tjƒ||ƒSt ¡\}}}|d|dd||ff‚)Nrßrrz %s %s) r;r¨r9rÜrYr®ÚS_IWRITEr¬r )ÚfuncÚargÚexcZetZevr{r7r7r8Ú auto_chmod¯s  rcCs0t|ƒ}t|tjƒ|rt|ƒdSt|ƒdS)aa Fix any globally cached `dist_path` related data `dist_path` should be a path of a newly installed egg distribution (zipped or unzipped). sys.path_importer_cache contains finder objects that have been cached when importing data from the original distribution. Any such finders need to be cleared since the replacement distribution might be packaged differently, e.g. a zipped egg distribution might get replaced with an unzipped egg folder or vice versa. Having the old finders cached may then cause Python to attempt loading modules from the replacement distribution using an incorrect loader. zipimport.zipimporter objects are Python loaders charged with importing data packaged inside zip archives. If stale loaders referencing the original distribution, are left behind, they can fail to load modules from the replacement distribution. E.g. if an old zipimport.zipimporter instance is used to load data from a new zipped egg archive, it may cause the operation to attempt to locate the requested data in the wrong location - one indicated by the original distribution's zip archive directory information. Such an operation may then fail outright, e.g. report having read a 'bad local file header', or even worse, it may fail silently & return invalid data. zipimport._zip_directory_cache contains cached zip archive directory information for all existing zipimport.zipimporter instances and all such instances connected to the same archive share the same cached directory information. If asked, and the underlying Python implementation allows it, we can fix all existing zipimport.zipimporter instances instead of having to track them down and remove them one by one, by updating their shared cached zip archive directory information. This, of course, assumes that the replacement distribution is packaged as a zipped egg. If not asked to fix existing zipimport.zipimporter instances, we still do our best to clear any remaining zipimport.zipimporter related cached data that might somehow later get used when attempting to load data from the new distribution and thus cause such load operations to fail. Note that when tracking down such remaining stale data, we can not catch every conceivable usage from here, and we clear only those that we know of and have found to cause problems if left alive. Any remaining caches should be updated by whomever is in charge of maintaining them, i.e. they should be ready to handle us replacing their zip archives with new distributions at runtime. N)rÚ_uncacher¬Úpath_importer_cacheÚ!_replace_zip_directory_cache_dataÚ*_remove_and_clear_zip_directory_cache_data)Z dist_pathrsÚnormalized_pathr7r7r8rv¸s <   rvcCsPg}t|ƒ}|D]}t|ƒ}| |¡r%|||d…tjdfvr%| |¡q|S)ap Return zipimporter cache entry keys related to a given normalized path. Alternative path spellings (e.g. those using different character case or those using alternative path separators) related to the same path are included. Any sub-path entries are included as well, i.e. those corresponding to zip archives embedded in other zip archives. rr¸)rérrgr;rËrÍ)r ÚcacheÚresultÚ prefix_lenÚpZnpr7r7r8Ú"_collect_zipimporter_cache_entries s  ÿ €rcCs@t||ƒD]}||}||=|o|||ƒ}|dur|||<qdS)a— Update zipimporter cache data for a given normalized path. Any sub-path entries are processed as well, i.e. those corresponding to zip archives embedded in other zip archives. Given updater is a callable taking a cache entry key and the original entry (after already removing the entry from the cache), and expected to update the entry and possibly return a new one to be inserted in its place. Returning None indicates that the entry should not be replaced with a new one. If no updater is given, the cache entries are simply removed without any additional processing, the same as if the updater simply returned None. N)r)r r ÚupdaterrÚ old_entryZ new_entryr7r7r8Ú_update_zipimporter_caches €òrcCst||ƒdSrš)r)r r r7r7r8r>r:rcCódd„}t|tj|ddS)NcSs | ¡dSrš)Úclear©r<rr7r7r8Ú2clear_and_remove_cached_zip_archive_directory_dataCs zf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data©r©rrmÚ_zip_directory_cache)r rr7r7r8r Bs  þr Z__pypy__cCr)NcSs&| ¡t |¡| tj|¡|Srš)rrmrnÚupdaterrr7r7r8Ú)replace_cached_zip_archive_directory_dataYs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarr)r rr7r7r8r Xs   þr úc Cs,z t||dƒWdSttfyYdSw)z%Is this string a valid Python script?ÚexecFT)rÚ SyntaxErrorÚ TypeError)rNrr7r7r8Ú is_pythonks ýÿr"c Cshz&tj|dd }| d¡}Wdƒn 1swYW|dkSW|dkSttfy3|YSw)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)Úencodingr¶Nú#!)rárrÞrýrþ)rÚfpÚmagicr7r7r8Úis_shus ÿüþÿr'cCs t |g¡S)z@Quote a command line argument according to Windows parsing rules©Ú subprocessÚ list2cmdline)rr7r7r8Ú nt_quote_args r+cCsH| d¡s | d¡r dSt||ƒrdS| d¡r"d| ¡d ¡vSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. r_ú.pywTr$rrF)r1r"rgÚ splitlinesr)rPrr7r7r8rM„s  rM)rYcGr÷ršr7)rvr7r7r8Ú_chmod–rør.c CsTt d||¡zt||ƒWdStjy)}z t d|¡WYd}~dSd}~ww)Nzchanging mode of %s to %ozchmod failed: %s)r rªr.r;Úerror)r<rZrcr7r7r8rYšs€ÿrYc@sŠeZdZdZgZeƒZedd„ƒZedd„ƒZ edd„ƒZ edd „ƒZ ed d „ƒZ d d „Z edd„ƒZdd„Zedd„ƒZedd„ƒZdS)Ú CommandSpeczm A command spec for a #! header, specified as a list of arguments akin to those passed to Popen. cCrô)zV Choose the best CommandSpec class based on environmental conditions. r7©rür7r7r8rJ«szCommandSpec.bestcCstj tj¡}tj d|¡S)NÚ__PYVENV_LAUNCHER__)r;r<r?r¬rrr)rüZ_defaultr7r7r8Ú_sys_executable²szCommandSpec._sys_executablecCs:t||ƒr|St|tƒr||ƒS|dur| ¡S| |¡S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rÓrŸÚfrom_environmentÚ from_string)rüZparamr7r7r8Ú from_param·s   zCommandSpec.from_paramcCs|| ¡gƒSrš)r3r1r7r7r8r4ÆszCommandSpec.from_environmentcCstj|fi|j¤Ž}||ƒS)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )ÚshlexrÄÚ split_args)rüÚstringr€r7r7r8r5ÊszCommandSpec.from_stringcCs<t | |¡¡|_t |¡}t|ƒsdg|jdd…<dSdS)Nz-xr)r7rÄÚ_extract_optionsÚoptionsr)r*rH)r˜rPÚcmdliner7r7r8Úinstall_optionsÓs  ÿzCommandSpec.install_optionscCs:|d ¡d}tƒ |¡}|r| d¡pdnd}| ¡S)zH Extract any options from the first line of the script. rIrrr¸)r-rÚmatchÚgrouprL)Z orig_scriptÚfirstr>r;r7r7r8r:Ùs  €zCommandSpec._extract_optionscCs| |t|jƒ¡Srš)Ú_renderrŸr;r—r7r7r8Ú as_headerãszCommandSpec.as_headercCs6d}|D]}| |¡r| |¡r|dd…Sq|S)Nz"'rr‰)rgr1)ÚitemZ_QUOTESÚqr7r7r8Ú _strip_quotesæs €zCommandSpec._strip_quotescCs t dd„|Dƒ¡}d|dS)Ncss|] }t | ¡¡VqdSrš)r0rErL)rœrCr7r7r8ržðs€ ÿz&CommandSpec._render..r$rIr()r€r<r7r7r8rAîs ÿ zCommandSpec._renderN)r·r¸r¹rºr;r¤r8rýrJr3r6r4r5r=r¼r:rBrErAr7r7r7r8r0¢s,        r0c@seZdZeddZdS)ÚWindowsCommandSpecFrµN)r·r¸r¹r¤r8r7r7r7r8rFùsrFc@sŠeZdZdZe d¡ ¡ZeZ e ddd„ƒZ e ddd„ƒZ e dd d „ƒZ ed d „ƒZe d d„ƒZe dd„ƒZe dd„ƒZe ddd„ƒZdS)rIz` Encapsulates behavior around writing entry point scripts for console and gui apps. aJ # EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r import re import sys # for compatibility with easy_install; see #2198 __requires__ = %(spec)r try: from importlib.metadata import distribution except ImportError: try: from importlib_metadata import distribution except ImportError: from pkg_resources import load_entry_point def importlib_load_entry_point(spec, group, name): dist_name, _, _ = spec.partition('==') matches = ( entry_point for entry_point in distribution(dist_name).entry_points if entry_point.group == group and entry_point.name == name ) return next(matches).load() globals().setdefault('load_entry_point', importlib_load_entry_point) if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) sys.exit(load_entry_point(%(spec)r, %(group)r, %(name)r)()) NFcCs6t dt¡|r tnt ¡}| d||¡}| ||¡S)Nz Use get_argsr¸)rkrlrmÚWindowsScriptWriterrIrJÚget_script_headerrK)rür±rÚwininstÚwriterÚheaderr7r7r8Úget_script_args(s  zScriptWriter.get_script_argscCs$tjdtdd|r d}| ||¡S)NzUse get_headerr¶)Ú stacklevelr)rkrlrmrO)rürPrrIr7r7r8rH0s ÿ zScriptWriter.get_script_headerc cs‚|dur | ¡}t| ¡ƒ}dD]-}|d}| |¡ ¡D]\}}| |¡|jtƒ}| ||||¡} | D]} | Vq7qqdS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. N©ZconsoleÚguiZ_scripts) rOrÔr<Z get_entry_mapr€Ú_ensure_safe_nameÚtemplater¯Ú_get_script_args) rür±rKrîÚtype_r?rÜZeprPrvr˜r7r7r8rK9s€   ÿüþzScriptWriter.get_argscCst d|¡}|r tdƒ‚dS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rÚsearchr×)rÜZ has_path_sepr7r7r8rPKs ÿzScriptWriter._ensure_safe_namecCs t dt¡|r t ¡S| ¡S©NzUse best)rkrlrmrGrJ)rüZ force_windowsr7r7r8Ú get_writerTs zScriptWriter.get_writercCs*tjdkstjdkrtjdkrt ¡S|S)zD Select the best ScriptWriter for this environment. Úwin32Újavarß)r¬rxr;rÜÚ_namerGrJr1r7r7r8rJZszScriptWriter.bestccs|||fVdSršr7)rürSrÜrKrPr7r7r8rRds€zScriptWriter._get_script_argsr¸cCs"|j ¡ |¡}| |¡| ¡S)z;Create a #! line, getting options (if any) from script_text)Úcommand_spec_classrJr6r=rB)rürPrÚcmdr7r7r8rOis zScriptWriter.get_header)NFrš)r¸N)r·r¸r¹rºrJrKr½rQr0rZrýrLrHrKr¼rPrVrJrRrOr7r7r7r8rIýs,!ß#       rIc@sLeZdZeZedd„ƒZedd„ƒZedd„ƒZedd„ƒZ e d d „ƒZ d S) rGcCst dt¡| ¡SrU)rkrlrmrJr1r7r7r8rVts zWindowsScriptWriter.get_writercCs"tt|d}tj dd¡}||S)zC Select the best ScriptWriter suitable for Windows )rZnaturalZSETUPTOOLS_LAUNCHERr)r¤ÚWindowsExecutableLauncherWriterr;rr)rüZ writer_lookupZlauncherr7r7r8rJzs þzWindowsScriptWriter.bestc #s’tddd|}|tjd ¡ d¡vr$djd itƒ¤Ž}t |t ¡gd¢}|  |¡|  ||¡}‡fdd „|Dƒ}ˆ|||d |fVd S) z For Windows, add a .py extensionú.pyar,rNZPATHEXTú;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)r]r_ú -script.pyú.pycú.pyor,r]cóg|]}ˆ|‘qSr7r7rV©rÜr7r8r¿”rÁz8WindowsScriptWriter._get_script_args..rUNr7) r¤r;rrrÄr«r¯rkrlÚ UserWarningr9Ú_adjust_header) rürSrÜrKrPÚextrÞrŽr¢r7rcr8rR‡s€ýý   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr ||}}t t |¡tj¡}|j||d}| |¡r%|S|S)z† Make sure 'pythonw' is used for gui and 'python' is used for console (regardless of what sys.executable is). rrrO)r9Úrepl)rrÚescapeÚ IGNORECASEÚsubÚ _use_header)rürSZ orig_headerrÿrgZ pattern_obÚ new_headerr7r7r8re—s z"WindowsScriptWriter._adjust_headercCs$|dd… d¡}tjdkpt|ƒS)zÝ Should _adjust_header use the replaced header? On non-windows systems, always use. On Windows systems, only use the replaced header if it resolves to an executable on the system. r¶r‰ú"rW)rLr¬rxr)rlZ clean_headerr7r7r8rk¥s zWindowsScriptWriter._use_headerN) r·r¸r¹rFrZrýrVrJrRrer¼rkr7r7r7r8rGqs     rGc@seZdZedd„ƒZdS)r\c #s˜|dkr d}d}dg}nd}d}gd¢}| ||¡}‡fdd„|Dƒ} ˆ|||d | fVˆd t|ƒd fVtƒsJˆd } | tˆƒd fVd Sd S)zG For Windows, add a .py extension and an .exe launcher rOz -script.pywr,Zclir_)r_r`racrbr7r7rVrcr7r8r¿ÁrÁzDWindowsExecutableLauncherWriter._get_script_args..rUr]r]z .exe.manifestN)reÚget_win_launcherr9Úload_launcher_manifest) rürSrÜrKrPZ launcher_typerfrŽZhdrr¢Zm_namer7rcr8rR³s$€  þùz0WindowsExecutableLauncherWriter._get_script_argsN)r·r¸r¹rýrRr7r7r7r8r\²sr\cCsJd|}tƒrtƒdkr| dd¡}q | dd¡}n| dd¡}td|ƒS)z« Load the Windows launcher (executable) suitable for launching a script. `type` should be either 'cli' or 'gui' Returns the executable as a byte string. z%s.exez win-arm64Ú.z-arm64.z-64.z-32.rª)r9rrMr)ÚtypeZ launcher_fnr7r7r8rnÖs   rncCst td¡}| d¡tƒS)Nzlauncher manifest.xmlrS)Ú pkg_resourcesrr·rTÚvars)rÜZmanifestr7r7r8roés roFcCst |||¡Srš)rBr§)r<Ú ignore_errorsÚonerrorr7r7r8r§îr:r§cCst d¡}t |¡|S)Né)r;Úumask)Útmpr7r7r8rXòs  rXc@seZdZdZdS)rmzF Warning for EasyInstall deprecations, bypassing suppression. N)r·r¸r¹rºr7r7r7r8rmøsrmrš)r)|rºrr²rrrZdistutils.errorsrrrr Zdistutils.command.installr r rër r Zdistutils.command.build_scriptsrrrr¬r;rmrBr%rÛrr®ròrJrkrˆr5r¾r)r7rárßZ sysconfigrrrªrrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrrrrrr r!r"r#r$r%r&r'r(r)r*r+ÚfilterwarningsZ PEP440WarningÚ__all__r9r.rErHrOr/rÂrËrÔr1r2r0rùrrrrrvrrrr Úbuiltin_module_namesr r"r'r+rMrYr.Ú ImportErrorrŸr0r3Zsys_executablerFrIrGr\rLrHrnror§rXrmr7r7r7r8ÚsÄ         DqF.)%l  R   ÿ    þTtA