a (šReœ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¡d4kr„eZZYd5d6„Z]d7d8„Z^d9d:„Z_d;d<„Z`did=d>„Zad?d@„ZbdAdB„ZcdCejdvrÐecZendDdE„ZedjdGdH„ZfdIdJ„ZgdKdL„ZhdMdN„ZizddOlmjZkWnely&dPdQ„ZkYn0dRdS„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ú•/builddir/build/BUILDROOT/alt-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/easy_install.pyÚis_64bitJsr9cCsjtj |¡otj |¡}ttjdƒo&|}|r:tj ||¡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)Úp1Úp2Z both_existZ use_samefileZnorm_p1Znorm_p2r7r7r8r.Nsr.cCs | d¡S)NÚutf8)Úencode©Úsr7r7r8Ú _to_bytes^srFcCs*z| d¡WdSty$YdS0dS)NÚasciiTF)rCÚ UnicodeErrorrDr7r7r8Úisasciibs   rIcCst |¡ ¡ dd¡S)NÚ z; )ÚtextwrapÚdedentÚstripÚreplace)Útextr7r7r8Ú _one_linerjsrPc@sxeZdZdZdZdZdddddd 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„Z0d’dYdZ„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=rEzinstall 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') rQrSrXrUrZrcrerhrjrkr`rQcCs2t dt¡d|_d|_|_d|_|_|_d|_ d|_ d|_ d|_ d|_ |_d|_|_|_d|_|_|_d|_|_|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ t!j"rØt!j#|_$t!j%|_&n d|_$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ÚEasyInstallDeprecationWarningrkÚzip_okÚlocal_snapshots_okÚ install_dirÚ script_dirÚexclude_scriptsÚ index_urlÚ find_linksÚbuild_directoryÚargsÚoptimizeÚrecordrUÚ always_copyÚ multi_versionrcÚno_depsÚ allow_hostsÚrootÚprefixÚ no_reportrjÚ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_projectsÚ_dry_runÚ distributionÚverboseÚ_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|¡|jrdStj |¡o.tj |¡ }|r8tntj}||ƒdS)Nz Deleting %s) r ÚinfoÚdry_runr:r;ÚisdirržÚrmtreeÚunlink)r›r;Zis_treeZremoverr7r7r8r¤×s  zeasy_install._delete_pathcCs8djtjŽ}tdƒ}d}t|jfitƒ¤Žƒtƒ‚dS)zT Render the Setuptools version and installation details, then exit. ú{}.{}Ú setuptoolsz=setuptools {dist.version} from {dist.location} (Python {ver})N)ÚformatÚsysÚ version_infor!ÚprintÚlocalsÚ SystemExit)ÚverÚdistÚtmplr7r7r8Ú_render_versionàs  zeasy_install._render_versionc CsŠ|jo | ¡tj ¡d}tddƒ\}}|j ¡|j ¡|j ¡||dd…|d|d||||t tddƒdœ |_ t j r–|j |j d <|j|j d <n|jr¦t d ¡| ¡| ¡| ¡| d d dd¡|jdurà|j|_|jdurðd|_| dd¡| dd¡|jr(|jr(|j|_|j|_| dd¡tttjƒ}tƒ|_ |j!dur¾dd„|j! d¡Dƒ}|D]N}t"j #|¡sŽt d|¡n,t|ƒ|vrªt$|dƒ‚n|j  %t|ƒ¡qn|j&sÎ| '¡|j(pØd|_(|j dd…|_)|jt|jƒfD] }||j)vrü|j) *d|¡qü|j+durBdd„|j+ d¡Dƒ}ndg}|j,durj|j-|j(|j)|d|_,t.|j)tjƒ|_/|j0dur¤t1|j0t2ƒrª|j0 ¡|_0ng|_0|j3rÆ|j, 4|j)tj¡|jsÜ|j, 5|j0¡| dd ¡t1|j6t7ƒsXz0t7|j6ƒ|_6d|j6krdks$nt8‚Wn0t8yV} zt$d!ƒ| ‚WYd} ~ n d} ~ 00|j&rp|j9spt:d"ƒ‚|j;s€t:d#ƒ‚g|_-sz1easy_install.finalize_options..ú,z"%s (in --site-dirs) does not existz$ (in --site-dirs) is not on sys.pathzhttps://pypi.org/simple/cSsg|] }| ¡‘qSr7)rMrÊr7r7r8rËCóÚ*)Ú search_pathÚhosts)rxrxz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rjr·r¯Úsplitrr–Úget_nameÚ get_versionÚ get_fullnameÚgetattrÚ config_varsr‰rŠrŒrŽrkr rmÚ_fix_install_dir_for_user_siteÚexpand_basedirsÚ expand_dirsÚ_expandrrrqrÚset_undefined_optionsrr…r£rr;Ú get_site_dirsÚ all_site_dirsr“r:r©rÚappendrcÚcheck_site_dirrtÚ shadow_pathÚinsertr}rÚ create_indexr#Ú local_indexruÚ isinstanceÚstrrpZscan_egg_linksÚadd_find_linksrxÚintÚ ValueErrorrvrrwÚoutputs) r›rÀrr¸r>r“rWÚ path_itemrÐrdr7r7r8Úfinalize_optionsësÆ  ô  þ  ÿÿ    þÿ    ÿ   ÿþÿÿzeasy_install.finalize_optionscCs\|jr tjsdS| ¡|jdur.d}t|ƒ‚|j|_|_tj   dd¡d}|  |¡dS)z; Fix the install_dir if "--user" was used. Nz$User base directory is not specifiedÚposixÚunixÚ_user) rkr‰rŠÚcreate_home_pathrŒr r‡rˆr:ÚnamerNÚ select_scheme)r›ÚmsgÚ scheme_namer7r7r8r×js  z+easy_install._fix_install_dir_for_user_sitecCsX|D]N}t||ƒ}|durtjdks.tjdkr:tj |¡}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.)rr‚r„rƒr…r†Nrú)r›Údirsr7r7r8rÙ‡szeasy_install.expand_dirsc Csâ|r| dtj¡|j|jjkr,t |j¡z |jD]}| ||j ¡q4|j r´|j }|j rŒt |j ƒ}t t |ƒƒD]}|||d…||<qrddlm}| |j|j |fd|j ¡| ¡Wt |jj¡nt |jj¡0dS)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')Úannouncer ÚWARNr—r–Ú set_verbosityrwr/r|ryrér~ÚlenÚrangeÚ distutilsrüÚexecuteÚ write_fileÚwarn_deprecated_options)r›Zshow_deprecationÚspecréÚroot_lenÚcounterrür7r7r8Úrun“s2ý     ÿþ zeasy_install.runcCsBz t ¡}Wn ty,t dtj¡}Yn0tj |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ÚrandomÚrandintr¯Úmaxsizer;Újoinrq)r›Úpidr7r7r8Úpseudo_tempname°s   zeasy_install.pseudo_tempnamecCsdSrr7ršr7r7r8r»sz$easy_install.warn_deprecated_optionsc CsJt|jƒ}tj |d¡}tj |¡sRzt |¡WnttfyP|  ¡Yn0||j v}|sp|j sp|  ¡}nb|  ¡d}tj |¡}z*|r˜t |¡t|dƒ ¡t |¡WnttfyÐ|  ¡Yn0|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)rrqr:r;rr<ÚmakedirsÚOSErrorÚIOErrorÚcant_write_to_targetrÝr{Úcheck_pth_processingrr«ÚopenÚcloseÚenvironÚgetr rmÚ_easy_install__no_default_msgr‘r0)r›Úinstdirr‘Z is_site_dirZtestfileZ test_existsÚ 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. cCsP|jt ¡d|jf}tj |j¡s6|d|j7}n|d|j7}t |ƒ‚dS)NérJ) Ú_easy_install__cant_write_msgr¯Úexc_inforqr:r;r<Ú_easy_install__not_exists_idÚ_easy_install__access_msgr)r›ròr7r7r8rs z!easy_install.cant_write_to_targetc Cs(|j}t d|¡| ¡d}|d}tj |¡}tdƒd}z6|rNt |¡tj  |¡}tj |ddt |dƒ}Wn t t fy”| ¡Yn|0z6| |jfitƒ¤Ž¡| ¡d }tj}tjd krtj |¡\}} tj |d ¡} |  ¡d kotj | ¡} | r| }d dlm} | |dddgd ƒtj |¡rŽt d|¡W|rZ| ¡tj |¡rrt |¡tj |¡rŠt |¡dSW|rž| ¡tj |¡r¶t |¡tj |¡rt |¡n@|rÞ| ¡tj |¡röt |¡tj |¡rt |¡0|js$t 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() rJT)Úexist_okrNrôú pythonw.exeú python.exer)Úspawnz-Ez-cÚpassz-TEST PASSED: %s appears to support .pth filesz+TEST FAILED: %s does NOT support .pth filesF)rqr r§rr:r;r<rPr«ÚdirnamerrrrrÚwriter®r²rr¯Ú executablerðrÑrÚlowerÚdistutils.spawnr*r{rm) r›rr‘Zok_fileZ ok_existsr¶r,r]r.ÚbasenameZaltZuse_altr*r7r7r8rsv   û    þ þ  ù  û   z!easy_install.check_pth_processingc CsV|jsH| d¡rH| d¡D],}| d|¡r.q| ||| d|¡¡q| |¡dS)z=Write all the scripts for `dist`, unless scripts are excludedÚscriptszscripts/N)rsÚmetadata_isdirÚmetadata_listdirÚinstall_scriptÚ get_metadataÚinstall_wrapper_scripts)r›rµÚ script_namer7r7r8Úinstall_egg_scriptsSs þz easy_install.install_egg_scriptscCsTtj |¡rDt |¡D]*\}}}|D]}|j tj ||¡¡q$qn |j |¡dSr)r:r;r©ÚwalkrérÞr)r›r;ÚbaserûÚfilesr r7r7r8Ú add_outputas  zeasy_install.add_outputcCs|jrtd|fƒ‚dS)NzjInvalid argument %r: you can't use filenames or URLs with --editable (except via the --find-links option).)rcr©r›rr7r7r8Ú not_editableis þÿzeasy_install.not_editablecCs<|js dStj tj |j|j¡¡r8td|j|jfƒ‚dS)Nz2%r already exists in %s; can't do a checkout there)rcr:r;r<rrvÚkeyrr>r7r7r8Úcheck_editableqs ÿÿzeasy_install.check_editablec csJtjdd}z"t|ƒVWtj |¡o,t|ƒntj |¡oBt|ƒ0dS)Nz easy_install-)r)ÚtempfileÚmkdtemprår:r;r<rª)r›Útmpdirr7r7r8Ú_tmpdir{s  zeasy_install._tmpdirFc CsX| ¡8}t|tƒs”t|ƒrV| |¡|j ||¡}| d|||d¡WdƒStj   |¡rŒ| |¡| d|||d¡WdƒSt |ƒ}|  |¡|j  |||j|j|j |j¡}|duræd|}|jrÜ|d7}t|ƒ‚nN|jtkr| |||d¡|WdƒS| ||j||¡WdƒSWdƒn1sJ0YdS)NTz+Could not find suitable distribution for %rz2 (--always-copy skips system and development eggs)ÚUsing)rErär$rr?rÚdownloadÚ install_itemr:r;r<rrAZfetch_distributionrUrcrzrãrÚ precedencer+Úprocess_distributionÚlocation)r›rÚdepsrDÚdlrµròr7r7r8r/„s0          þ  zeasy_install.easy_installcCs |p|j}|ptj |¡|k}|p,| d¡ }|pT|jduoTtj t|ƒ¡t|jƒk}|r‚|s‚|j|jD]}|j |krjq‚qjd}t   dtj  |¡¡|rÂ|  |||¡}|D]}| |||¡q¬n | |¡g}| ||d|d¡|dur|D]}||vrð|SqðdS)Nú.eggTz Processing %srrF)rzr:r;r,Úendswithr’rrãÚ project_namerKr r§r1Ú install_eggsrJÚegg_distribution)r›rrGrDrLZinstall_neededrµÚdistsr7r7r8rH¥s2  ÿþ   zeasy_install.install_itemcCs<t|}tD]*}d|}t||ƒdur t||||ƒq dS)z=Sets the install directories by applying the install schemes.Úinstall_N)r r rÕrõ)r›rðÚschemer@Úattrnamer7r7r8rñÉs zeasy_install.select_schemec Gs¾| |¡|j |¡||j|jvr2|j |¡|j |¡| |¡||j|j<t  |j ||g|¢RŽ¡|  d¡r|j s|j  | d¡¡|sž|jsždS|durÂ|j|jkrÂt d|¡dS|dusÒ||vræ| ¡}tt|ƒƒ}t  d|¡ztgƒ |g|j|j¡}WnftyB}ztt|ƒƒ|‚WYd}~nrÍz-easy_install.write_script..zInstalling %s script to %sNriÿ)r¦r r§rrr:r;rr=r¨Ú current_umaskr r<r«rr-Úchmod)r›r8riÚmoder¥ÚtargetÚmaskr]r7ršr8rn;sÿ   (zeasy_install.write_scriptc CsR|j|j|jdœ}z|| ¡dd…}Wnty<Yn0|||ƒgS|}tj |¡rt| d¡stt |||j ƒntj  |¡rŒtj  |¡}|  |¡r²|jr²|dur²| |||¡}tj |d¡}tj |¡s$ttj |dd¡ƒ}|sútdtj  |¡ƒ‚t|ƒdkrtdtj  |¡ƒ‚|d }|jrBt | ||¡¡gS| ||¡SdS) N)rNú.exez.whléüÿÿÿú.pyzsetup.pyrÎz"Couldn't find a setup script in %sr!zMultiple setup scripts in %sr)Ú install_eggÚ install_exeÚ install_wheelr/ÚKeyErrorr:r;ÚisfilerOrÚunpack_progressr©ÚabspathÚ startswithrvrjrr<rrrrcr r§Úreport_editableÚbuild_and_install) r›rrfrDZ installer_mapZ install_distrgÚ setup_scriptZsetupsr7r7r8rQOsTýÿ     ÿÿ ÿÿ ÿÿzeasy_install.install_eggscCs>tj |¡r"t|tj |d¡ƒ}ntt |¡ƒ}tj ||dS)NúEGG-INFO)Úmetadata) r:r;r©r&rr'Ú zipimportÚ zipimporterr%Ú from_filename)r›Úegg_pathrr7r7r8rR‚s   ÿzeasy_install.egg_distributionc CsŒtj |jtj |¡¡}tj |¡}|js2t|ƒ| |¡}t ||ƒsxtj  |¡rrtj  |¡srt j ||jdn"tj |¡r”| tj|fd|¡zÀd}tj  |¡rÌ| |¡r¾tjd}}n tjd}}nL| |¡rî| |¡|jd}}n*d}| |¡r tjd}}n tjd}}| |||f|dtj |¡tj |¡f¡t||d Wn"tyvt|dd ‚Yn0| |¡| |¡S) N©r¨ú Removing FZMovingZCopyingZ ExtractingTz %s to %s©Úfix_zipimporter_caches)r:r;rrqr1r‡r¨r rRr.r©ržr Ú remove_treer<rr«rˆrdreÚcopytreerbÚmkpathÚunpack_and_compileÚcopy2r,Úupdate_dist_cachesr r=)r›r‘rDÚ destinationrµZnew_dist_is_zippedr]rTr7r7r8r‹s^ þ    ý        þýþ   zeasy_install.install_eggc sPt|ƒ}|durtd|ƒ‚td| dd¡| dd¡tƒd}tj || ¡d¡}||_ |d}tj |d¡}tj |d ¡}t |ƒt ||ƒ|_ |  ||¡tj |¡st|d ƒ} |  d ¡| d¡D].\} } | d krÊ|  d |  dd¡ ¡| f¡qÊ|  ¡tj |d¡‰| ‡fdd„t |¡Dƒ¡tj|||j|jd| ||¡S)Nz(%s is not a valid distutils Windows .exerrðrj)rPrjÚplatformrNz.tmprŒúPKG-INFOrzMetadata-Version: 1.0 Útarget_versionz%s: %s Ú_ú-r2csg|]}tj ˆ|d¡‘qS)r)r:r;r)rŸrw©rrr7r8rËãsÿz,easy_install.install_exe..)r—r¨)r1rr%rrr:r;rÚegg_namerKr r&Ú _providerÚ exe_to_eggr<rr-ÚitemsrNÚtitlerr¦rkrmrÚ make_zipfiler—r¨r) r›rfrDÚcfgrµr‘Úegg_tmpZ _egg_infoZpkg_infr]ÚkÚvr7r¢r8r‚ÁsBÿ ý     þ ÿzeasy_install.install_exec s8t|ƒ‰g‰g‰i‰‡‡‡‡‡fdd„}t|ˆ|ƒg}ˆD]n}| ¡ d¡r<| d¡}|d}t |d¡d|d<tjj ˆg|¢RŽ}ˆ  |¡|  |¡t  ||¡q<|  ˆ¡t  tj  ˆd¡t ˆ|¡¡dD]Z} tƒ| rØtj  ˆd| d ¡} tj | ¡sØt| d ƒ} |  d   tƒ| ¡d ¡|  ¡qØd S) z;Extract a bdist_wininst to the directories an egg would usecsú| ¡}ˆD]Ò\}}| |¡r ||t|ƒd…}| d¡}tjjˆg|¢RŽ}| ¡}| d¡sl| d¡r¢t  |d¡|d<dˆtj  |d¡d<ˆ  |¡n4| d¡rÖ|dkrÖdˆtj  |d¡d<ˆ  |¡|Sq | d ¡söt   d |¡dS) Nú/ú.pydú.dlléÿÿÿÿr!rr€úSCRIPTS/r&zWARNING: can't process %s)r/rˆrrÑr:r;rrOrÚ strip_moduleÚsplitextrÞr rm)ÚsrcrhrEÚoldÚnewÚpartsrM©rªÚ native_libsÚprefixesÚ to_compileÚ top_levelr7r8Úprocess÷s$        z(easy_install.exe_to_egg..processr®r­r°r€rŒ)r¼r¹z.txtrrJN)r2rr/rOrÑrr²r:r;rrÞZ write_stubÚ byte_compileZwrite_safety_flagZ analyze_eggr²r<rr-r) r›rfrªr½ZstubsÚresr·ÚresourceZpyfilerðÚtxtr]r7r¸r8r¥ïs8       þ   zeasy_install.exe_to_eggc Csìt|ƒ}| ¡sJ‚tj |j| ¡¡}tj |¡}|jsBt |ƒtj  |¡rltj  |¡slt j ||jdn"tj |¡rŽ| tj|fd|¡z:| |j|fdtj |¡tj |¡f¡Wt|ddnt|dd0| |¡| |¡S)Nr’r“zInstalling %s to %sFr”)rÚ is_compatibler:r;rrqr£r‡r¨r r©ržr r–r<rr«Zinstall_as_eggr1r,r›r=rR)r›Ú wheel_pathrDÚwheelrœr7r7r8rƒ$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)srJr¼) r{r€Ú_easy_install__mv_warningrqr£rr¯r;Ú_easy_install__id_warningrKrPrjr²) r›ÚreqrµÚwhatròZegglocrðrjÚextrasr7r7r8rZRs 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)NrJ)r:r;r,r¯r.Ú_easy_install__editable_msgr²)r›rr‹r,Úpythonr7r7r8r‰ks zeasy_install.report_editablec Csètj dt¡tj dt¡t|ƒ}|jdkrNd|jd}| dd|¡n|jdkrd| dd¡|jrv| dd ¡t   d |t |ƒdd…d   |¡¡zt ||ƒWn:tyâ}z"td |jdfƒ|‚WYd}~n d}~00dS) Nzdistutils.command.bdist_eggzdistutils.command.egg_inforºr¬r!rr¡z-qz-nz Running %s %sú zSetup script exited with %s)r¯ÚmodulesÚ setdefaultrrr¢r—rár¨r r§rrrr³rrw)r›r‹rgrwr¬r7r7r8rps*    ÿÿþzeasy_install.run_setupc CsÎddg}tjdtj |¡d}z”| tj |¡¡| |¡| |||¡t|gƒ}g}|D]&}||D]}| |  |j |¡¡qhq\|sš|j sšt   d|¡|Wt|ƒt  |j¡St|ƒt  |j¡0dS)Nrz --dist-dirz egg-dist-tmp-)rÚdirz+No eggs found in %s (setup script problem?))rBrCr:r;r,Ú_set_fetcher_optionsrÞrr#rrKr¨r rmrªrÿr—) r›r‹rgrwÚdist_dirZall_eggsÚeggsr@rµr7r7r8rŠ†s2 ÿ    ÿ ýÿzeasy_install.build_and_installc Csh|j d¡ ¡}d}i}| ¡D]\}}||vr2q |d||<q t|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/)rur“rtrxr}r!)r/z setup.cfgN) r–r™Úcopyr¦Údictr:r;rrZ edit_config) r›r;Zei_optsZfetch_directivesZ fetch_optionsr@røÚsettingsZ cfg_filenamer7r7r8rÑžs  z!easy_install._set_fetcher_optionscCsL|jdurdS|j|jD]J}|js2|j|jkr2qt d|¡|j |¡|j|jvr|j |j¡q|jsº|j|jjvrˆt d|¡n2t d|¡|j  |¡|j|jvrº|j  |j¡|j rÄdS|j  ¡|jdkrÜdSt j |jd¡}t j |¡rt  |¡t|dƒ(}| |j |j¡d¡Wdƒn1s>0YdS)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ÚwtrJ)r‘r@r{rKr r§rYràÚpathsrXrÞr¨Úsaver:r;rrqržr«rr-Ú make_relative)r›rµrWr r]r7r7r8rWµs:    þ       zeasy_install.update_pthcCst d||¡|S)NzUnpacking %s to %s)r Údebug)r›r´rhr7r7r8r†Þszeasy_install.unpack_progresscsdg‰g‰‡‡‡fdd„}t|||ƒˆ ˆ¡ˆjs`ˆD]&}t |¡tjdBd@}t||ƒq8dS)NcsZ| d¡r | d¡s ˆ |¡n| d¡s4| d¡r>ˆ |¡ˆ ||¡ˆj rV|pXdS)Nr€ú EGG-INFO/r¯z.so)rOrˆrÞr†r¨)r´rh©r›Zto_chmodr»r7r8Úpfçs    z+easy_install.unpack_and_compile..pfimií)rr¾r¨r:ÚstatÚST_MODErz)r›r‘rœrßr]r{r7rÞr8r™ãs  zeasy_install.unpack_and_compilec Csvtjr dSddlm}zLt |jd¡||dd|jd|jrT|||jd|jdWt |j¡nt |j¡0dS)Nr)r¾r!)rxÚforcer¨) r¯Údont_write_bytecodeÚdistutils.utilr¾r rÿr—r¨rx)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|js dSttj d¡ƒ}|j ¡D]8\}}| |¡r$tj |¡s$|  d|¡t  |d¡q$dS)zCreate directories under ~.Nú~zos.makedirs('%s', 0o700)iÀ) rkrr:r;rÉrÖr¦rˆr©Ú debug_printr)r›Úhomerðr;r7r7r8rï)szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/binrÇ©rìz$base/Lib/site-packagesz $base/ScriptscGs¼| d¡j}|jrd| ¡}|j|d<|j tj|j¡}|  ¡D]$\}}t ||dƒdur>t |||ƒq>ddl m }|D]B}t ||ƒ}|durt|||ƒ}tjdkrªtj |¡}t |||ƒqtdS)NrÈr;r)rrì)Úget_finalized_commandrÖrrÔr rr:rðÚDEFAULT_SCHEMEr¦rÕrõrärr;rÉ)r›rörÖrUr÷rørr7r7r8rÚ?s        zeasy_install._expand)T)F)F)T)N)rwr7)rÅ)MÚ__name__Ú __module__Ú __qualname__Ú__doc__Ú descriptionZcommand_consumes_argumentsr‰rÚ user_optionsÚboolean_optionsÚ negative_optrrârœr¦r¤Ú staticmethodr·rër×rùrØrÙr rrrßrKrLÚlstripr"r$r%rrr9r=r?rAÚ contextlibÚcontextmanagerrEr/rHrñrJrbrjr7r5rprnrQrRrr‚r¥rƒrÆrÇrZrËr‰rrŠrÑrWr†r™r¾rMrrïrÕr rêrÚr7r7r7r8r/nsÂä5     - ;   ! $ ÿ )    3 6.5   )  þÿþr/cCs tj dd¡ tj¡}td|ƒS)Nrr¼)r:rrrÑÚpathsepÚfilter)r¦r7r7r8Ú _pythonpathVsrùc sŽg‰ˆ tƒ¡tjg}tjtjkr0| tj¡|D]Ð}|s>q4tjdvr`ˆ tj  |dd¡¡nVtj dkrœˆ tj  |ddj tj Žd¡tj  |dd¡g¡nˆ |tj  |dd¡g¡tjdkrÂq4d |vrÌq4tj  d ¡}|sÞq4tj  |d d d j tj Žd¡}ˆ |¡q4tdƒtdƒf}ˆ ‡fdd„|Dƒ¡tjrBˆ tj¡t t¡ˆ t ¡¡Wdƒn1sr0Ytttˆƒƒ‰ˆS)z& Return a list of 'site' dirs )Zos2emxZriscosÚLibz site-packagesr­Úlibz python{}.{}z site-pythonÚdarwinzPython.frameworkÚHOMEÚLibraryÚPythonr¬ÚpurelibÚplatlibc3s|]}|ˆvr|VqdSrr7rÊ©Úsitedirsr7r8r¡”rÍz get_site_dirs..N)Úextendrùr¯rr¸rÞrr:r;rÚsepr®r°rrrr‰rŠrrõÚsuppressÚAttributeErrorÚgetsitepackagesr¢r£r)rºrrçZhome_spZ lib_pathsr7rr8rÜ[s^      üù þ   û   .rÜccsæi}|D]Ø}t|ƒ}||vrqd||<tj |¡s4qt |¡}||fV|D]’}| d¡s\qL|dvrfqLttj ||¡ƒ}tt |ƒƒ}|  ¡|D]L}|  d¡r qt|  ¡ƒ}||vr¶qd||<tj |¡sÌq|t |¡fVqqLqdS)zBYield sys.path directories that might contain "old-style" packagesr!r&)rr×ÚimportN) rr:r;r©rcrOrrr¢rrrˆÚrstrip)ÚinputsÚseenr,r<rðr]ÚlinesÚliner7r7r8Ú expand_paths¡s8        rc Cs`t|dƒ}zDt |¡}|dur.W| ¡dS|d|d|d}|dkr\W| ¡dS| |d¡t d| d¡¡\}}}|dvr˜W| ¡dS| |d|¡d d d œ}t  |¡}z<| |¡} |   d d ¡d } |   t   ¡¡} | t | ¡¡Wn"tjyYW| ¡dS0| d¡r6| d¡sDW| ¡dS|W| ¡S| ¡0dS)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ºržr!z .egg-inforNrÝr&z -nspkg.pth)ZPURELIBZPLATLIBú\r z%s/%s/r¼cSsg|]\}}| ¡|f‘qSr7)r/)rŸrYÚyr7r7r8rËrÍz$get_exe_prefixes..)rÚZipFileÚinfolistr rÑrrOrárÚupperrrvrrMrNrˆrÞrÚsortÚreverse)Z exe_filenamerºrRr§rðr·riÚpthr7r7r8r2øs2       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ƒƒƒqLdS)NT)r r¢r£rrr:r;r,ÚbasedirÚ_loadr#Ú__init__rrÙrXr")r›r rr;r7r7r8r3"szPthDistributions.__init__cCsþg|_d}t |j¡}tj |j¡rÊt|jdƒ}|D]Œ}|  d¡rHd}q4|  ¡}|j  |¡|  ¡r4|  ¡  d¡rtq4t tj |j|¡ƒ}|jd<tj |¡r¦||vr¸|j ¡d|_q4d||<q4| ¡|jrÚ|sÚd|_|jrú|jd  ¡sú|j ¡qÚdS)NFÚrtr Tú#r°r!)rÙrÕÚfromkeysrr:r;r…r rrˆr rÞrMrrr1r<ÚpopÚdirtyr)r›Z saw_importr r]rr;r7r7r8r2+s4    ÿ   zPthDistributions._loadcCsÊ|js dStt|j|jƒƒ}|r˜t d|j¡| |¡}d  |¡d}t j   |j¡r`t   |j¡t|jdƒ}| |¡WdƒqÀ1sŒ0Yn(t j  |j¡rÀt d|j¡t   |j¡d|_dS)z$Write changed .pth file back to diskNz Saving %srJrØzDeleting empty %sF)r8r¢r£rÛrÙr rÜr Ú _wrap_linesrr:r;ržr«rr-r<)r›Z rel_pathsr Údatar]r7r7r8rÚJs  * zPthDistributions.savecCs|Srr7)r r7r7r8r9`szPthDistributions._wrap_linescCsN|j|jvo$|j|jvp$|jt ¡k}|r>|j |j¡d|_t ||¡dS)z"Add `dist` to the distribution mapTN) rKrÙrr:ÚgetcwdrÞr8r#rX)r›rµÚnew_pathr7r7r8rXds   üzPthDistributions.addcCs2|j|jvr"|j |j¡d|_qt ||¡dS)z'Remove `dist` from the distribution mapTN)rKrÙrYr8r#rar7r7r8rYrs zPthDistributions.removecCsŒtj t|ƒ¡\}}t|jƒ}|g}tjdkr2dp6tj}t|ƒ|krˆ||jkrl| tj ¡|  ¡|  |¡Stj |¡\}}| |¡q8|S)Nr­) r:r;rÑrrr1ÚaltseprrÞÚcurdirr/r)r›r;ÚnpathÚlastZbaselenr·rr7r7r8rÛys      zPthDistributions.make_relativeN)r7) rërìrírîr8r3r2rÚrór9rXrYrÛr7r7r7r8r0s  r0c@s(eZdZedd„ƒZedƒZedƒZdS)ÚRewritePthDistributionsccs$|jV|D] }|Vq |jVdSr)ÚpreludeÚpostlude)Úclsr rr7r7r8r9Šsz#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íÚ classmethodr9rPrBrCr7r7r7r8rA‰s rAZSETUPTOOLS_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Úcompilervr7r7r7r8Ú_first_line_re£s rJcCs\|tjtjfvr.tjdkr.t|tjƒ||ƒSt ¡\}}}|d|dd||ff‚dS)Nrôrr!z %s %s) r:r«rYrðrzràÚS_IWRITEr¯r#)ÚfuncÚargÚexcÚetZevr r7r7r8Ú auto_chmod¯s  rPcCs.t|ƒ}t|tjƒ|r"t|ƒnt|ƒ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)Ú dist_pathr•Únormalized_pathr7r7r8r›¸s <  r›cCsPg}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. r!r¼)rrrˆr:rrÞ)rVÚcacheÚresultÚ prefix_lenÚpÚnpr7r7r8Ú"_collect_zipimporter_cache_entries s  ÿ r\cCs@t||ƒD]0}||}||=|o(|||ƒ}|dur |||<q dS)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\)rVrWÚupdaterrZÚ old_entryZ new_entryr7r7r8Ú_update_zipimporter_caches  r_cCst||ƒdSr)r_)rVrWr7r7r8rQ>srQcCsdd„}t|tj|ddS)NcSs | ¡dSr)Úclear©r;r^r7r7r8Ú2clear_and_remove_cached_zip_archive_directory_dataCszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data©r]©r_rŽÚ_zip_directory_cache)rVrbr7r7r8rTBs þrTZ__pypy__cCsdd„}t|tj|ddS)NcSs&| ¡t |¡| tj|¡|Sr)r`rŽrÚupdatererar7r7r8Ú)replace_cached_zip_archive_directory_dataYs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_datarcrd)rVrgr7r7r8rSXs  þrSúc Cs2zt||dƒWnttfy(YdS0dSdS)z%Is this string a valid Python script?ÚexecFTN)rIÚ SyntaxErrorÚ TypeError)rOr r7r7r8Ú is_pythonks rlc Cs`zr¯r.rr)rDÚ_defaultr7r7r8Ú_sys_executable²szCommandSpec._sys_executablecCs:t||ƒr|St|tƒr ||ƒS|dur0| ¡S| |¡S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rär¢Úfrom_environmentÚ from_string)rDÚparamr7r7r8Ú from_param·s  zCommandSpec.from_paramcCs|| ¡gƒSr)r~r{r7r7r8rÆ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)rDÚstringr¦r7r7r8r€ÊszCommandSpec.from_stringcCs8t | |¡¡|_t |¡}t|ƒs4dg|jdd…<dS)Nz-xr)rƒrÑÚ_extract_optionsÚoptionsrsrtrI)r›rrÚcmdliner7r7r8Úinstall_optionsÓs zCommandSpec.install_optionscCs:|d ¡d}tƒ |¡}|r.| d¡p0dnd}| ¡S)zH Extract any options from the first line of the script. rJrr!r¼)rwrJÚmatchÚgrouprM)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"'r!r°)rˆrO)ÚitemZ_QUOTESÚqr7r7r8Ú _strip_quotesæs zCommandSpec._strip_quotescCs t dd„|Dƒ¡}d|dS)Ncss|]}t | ¡¡VqdSr)rzr‘rM)rŸrr7r7r8r¡ðsz&CommandSpec._render..rnrJrr)r¦rˆr7r7r8rîs ÿzCommandSpec._renderN)rërìrírîr‡rÕr„rErlr~r‚rr€r‰rór†rŽr‘rr7r7r7r8rz¢s*       rzc@seZdZeddZdS)ÚWindowsCommandSpecFrèN)rërìrírÕr„r7r7r7r8r’ùsr’c@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)rkz` 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¡|rtnt ¡}| d||¡}| ||¡S)Nz Use get_argsr¼)rlrmrnÚWindowsScriptWriterrkrlÚget_script_headerrm)rDrµr.ÚwininstÚwriterÚheaderr7r7r8Úget_script_args(s zScriptWriter.get_script_argscCs$tjdtdd|rd}| ||¡S)NzUse get_headerrº)Ú stacklevelr))rlrmrnrq)rDrrr.r•r7r7r8r”0s ÿzScriptWriter.get_script_headerc cs€|dur| ¡}t| ¡ƒ}dD]Z}|d}| |¡ ¡D]>\}}| |¡|jtƒ}| ||||¡} | D] } | Vqlq:q dS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. N©ÚconsoleÚguiZ_scripts) rqrår]Ú get_entry_mapr¦Ú_ensure_safe_nameÚtemplater²Ú_get_script_args) rDrµr—rÚtype_r‹rðÚeprrrwr¿r7r7r8rm9s   zScriptWriter.get_argscCst d|¡}|rtdƒ‚dS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rHÚsearchrè)rðZ has_path_sepr7r7r8ržKs zScriptWriter._ensure_safe_namecCs t dt¡|rt ¡S| ¡S©NzUse best)rlrmrnr“rl)rDZ force_windowsr7r7r8Ú get_writerTs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&t ¡S|SdS)zD Select the best ScriptWriter for this environment. Úwin32ÚjavarôN)r¯rr:rðÚ_namer“rlr{r7r7r8rlZszScriptWriter.bestccs|||fVdSrr7)rDr¡rðr—rrr7r7r8r dszScriptWriter._get_script_argsr¼cCs"|j ¡ |¡}| |¡| ¡S)z;Create a #! line, getting options (if any) from script_text)Úcommand_spec_classrlr‚r‰rŽ)rDrrr.Úcmdr7r7r8rqis zScriptWriter.get_header)NF)NF)N)r¼N)rërìrírîrKrLrôrŸrzr©rEr˜r”rmróržr¥rlr rqr7r7r7r8rkýs&#       rkc@sLeZdZeZedd„ƒZedd„ƒZedd„ƒZedd„ƒZ e d d „ƒZ d S) r“cCst dt¡| ¡Sr¤)rlrmrnrlr{r7r7r8r¥ts zWindowsScriptWriter.get_writercCs"tt|d}tj dd¡}||S)zC Select the best ScriptWriter suitable for Windows )r.ZnaturalZSETUPTOOLS_LAUNCHERr.)rÕÚWindowsExecutableLauncherWriterr:rr)rDZ writer_lookupÚlauncherr7r7r8rlzs þzWindowsScriptWriter.bestc #stddd|}|tjd ¡ d¡vrFdjfitƒ¤Ž}t |t ¡gd¢}|  |¡|  ||¡}‡fdd „|Dƒ}ˆ|||d |fVd S) z For Windows, add a .py extensionú.pyarvršÚPATHEXTú;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.)r­r€ú -script.pyú.pycú.pyorvr~csg|] }ˆ|‘qSr7r7rx©rðr7r8rË”rÍz8WindowsScriptWriter._get_script_args..rwN) rÕr:rr/rÑr®r²rlrmÚ UserWarningrYÚ_adjust_header) rDr¡rðr—rrÚextròrµr¥r7r³r8r ‡sÿý   z$WindowsScriptWriter._get_script_argscCsNd}d}|dkr||}}t t |¡tj¡}|j||d}| |¡rJ|S|S)z† Make sure 'pythonw' is used for gui and 'python' is used for console (regardless of what sys.executable is). r(r)rœ)r…Úrepl)rHrIÚescapeÚ IGNORECASEÚsubÚ _use_header)rDr¡Z orig_headerrGr·Z pattern_obÚ new_headerr7r7r8rµ—s z"WindowsScriptWriter._adjust_headercCs$|dd… d¡}tjdkp"t|ƒ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°ú"r¦)rMr¯rr)r¼Z clean_headerr7r7r8r»¥s zWindowsScriptWriter._use_headerN) rërìrír’r©rEr¥rlr rµrór»r7r7r7r8r“qs    r“c@seZdZedd„ƒZdS)r«c #s’|dkrd}d}dg}nd}d}gd¢}| ||¡}‡fdd„|Dƒ} ˆ|||d | fVˆd t|ƒd fVtƒsŽˆd } | tˆƒd fVd S)zG For Windows, add a .py extension and an .exe launcher rœz -script.pywrvÚclir°)r€r±r²csg|] }ˆ|‘qSr7r7rxr³r7r8rËÁrÍzDWindowsExecutableLauncherWriter._get_script_args..rwr~r^z .exe.manifestN)rµÚget_win_launcherr9Úload_launcher_manifest) rDr¡rðr—rrZ launcher_typer¶rµÚhdrr¥Zm_namer7r³r8r ³s   þz0WindowsExecutableLauncherWriter._get_script_argsN)rërìrírEr r7r7r7r8r«²sr«cCsJd|}tƒr4tƒ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­)r9rrNr)ÚtypeZ launcher_fnr7r7r8r¿Ös  r¿cCst td¡}| d¡tƒS)Nzlauncher manifest.xmlru)Ú pkg_resourcesrrërvÚvars)rðÚmanifestr7r7r8rÀés rÀFcCst |||¡Sr)rdrª)r;Ú ignore_errorsÚonerrorr7r7r8rªîsrªcCst d¡}t |¡|S)Né)r:Úumask)Útmpr7r7r8ryòs  ryc@seZdZdZdS)rnzF Warning for EasyInstall deprecations, bypassing suppression. N)rërìrírîr7r7r7r8rnøsrn)N)rh)|rîrrärrrÚdistutils.errorsrrrr Údistutils.command.installr r rr r Zdistutils.command.build_scriptsrr0rr¯r:rŽrdrBrrHràr rKrlr‰r5rõrsrƒr rÚ sysconfigrrr­rrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrÄrrrr r!r"r#r$r%r&r'r(r)r*r+ÚfilterwarningsÚ PEP440WarningÚ__all__r9r.rFrIrPr/rùrÜrr1r2r0rArrrJrPr›r\r_rQrTÚbuiltin_module_namesrSrlrqrurorzrxÚ ImportErrorr¢rzr~Zsys_executabler’rkr“r«r˜r”r¿rÀrªryrnr7r7r7r8ÚsÀ          DqF.)%l  R  ÿ  TtA