B ‘–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;jLddddddgZMdd„ZNdd„ZOdd „ZPd!d"„ZQd#d$„ZRGd%d„de,ƒZSd&d'„ZTd(d)„ZUd*d+„ZVd,d„ZWd-d„ZXGd.d„deBƒZYGd/d0„d0eYƒZZej[ \d1d2¡d3krŠeZZYd4d5„Z]d6d7„Z^d8d9„Z_d:d;„Z`dhdd?„Zbd@dA„ZcdBejdkrÖecZendCdD„ZedidFdG„ZfdHdI„ZgdJdK„ZhdLdM„ZiyddNlmjZkWnelk r.dOdP„ZkYnXdQdR„ZjGdSdT„dTemƒZnen o¡ZpGdUdV„dVenƒZqGdWdX„dXƒZrGdYdZ„dZerƒZsGd[d\„d\esƒZterjuZuerjvZvd]d^„Zwd_d`„Zxdae^fdbdc„Zyddde„ZzGdfdg„dge+ƒZ{d S)ja0 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-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/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.NscCs | d¡S)NÚutf8)Úencode)Úsr7r7r8Ú _to_bytes^srEcCs(y| d¡dStk r"dSXdS)NÚasciiTF)rCÚ UnicodeError)rDr7r7r8Úisasciibs  rHcCst |¡ ¡ dd¡S)NÚ z; )ÚtextwrapÚdedentÚstripÚreplace)Útextr7r7r8Ú _one_linerjsrOc@sˆeZdZdZdZdZdddddd d d d d ddddddddddddddejfgZddddd d!d"d#d$dg Z d%diZ e Z d&d'„Z d(d)„Zd*d+„Zed,d-„ƒZd.d/„Zd0d1„Zd2d3„Zd4d5„Zd6d7„Zd•d8d9„Zd:d;„Zdd?„Ze d@¡ ¡Ze dA¡ ¡Ze dB¡ ¡Z dCdD„Z!dEdF„Z"dGdH„Z#dIdJ„Z$dKdL„Z%dMdN„Z&e'j(dOdP„ƒZ)d–dRdS„Z*d—dTdU„Z+dVdW„Z,d˜dXdY„Z-dZd[„Z.d\d]„Z/d^d_„Z0d™d`da„Z1edbdc„ƒZ2dšdfdg„Z3dhdi„Z4djdk„Z5dldm„Z6dndo„Z7dpdq„Z8drds„Z9e dt¡ ¡Z:e du¡Z;d›dwdx„Zd|d}„Z?d~d„Z@d€d„ZAd‚dƒ„ZBd„d…„ZCd†d‡„ZDdˆd‰„ZEe dŠ¡ F¡ZGd‹dŒ„ZHeIeIddŽddZJeId‘d’dZKd“d”„ZLdS)œr/z'Manage a download/build/install processz Find/get/install Python packagesT)zprefix=Nzinstallation prefix)zzip-okÚzzinstall package as a zipfile)z 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)zexclude-scriptsÚxzDon't install scripts)z 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)z 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)zno-depsÚNzdon't install dependencies)z allow-hosts=ÚHz$pattern(s) that hostnames must match)zlocal-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'zzip-okz multi-versionzexclude-scriptsrRz always-copyr]zno-depszlocal-snapshots-okrbz always-unzipcCs2t 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ÚEasyInstallDeprecationWarningrcÚzip_okÚlocal_snapshots_okÚ install_dirÚ script_dirÚexclude_scriptsÚ index_urlÚ find_linksÚbuild_directoryÚargsÚoptimizeÚrecordrRÚ always_copyÚ multi_versionr]Úno_depsÚ allow_hostsÚrootÚprefixÚ no_reportrbÚ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›sJ     zeasy_install.initialize_optionscCs"dd„|Dƒ}tt|j|ƒƒdS)Ncss*|]"}tj |¡stj |¡r|VqdS)N)r:r;r<Úislink)Ú.0Úfilenamer7r7r8ú Òsz/easy_install.delete_blockers..)ÚlistÚmapÚ _delete_path)r’ÚblockersZextant_blockersr7r7r8Údelete_blockersÐszeasy_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_pathcCs4djtjŽ}tdƒ}d}t|jftƒŽƒtƒ‚dS)zT Render the Setuptools version and installation details, then exit. z{}.{}Ú 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¡|jdkrà|j|_|jdkrðd|_| dd¡| dd¡|jr(|jr(|j|_|j|_| dd¡tttjƒ}tƒ|_ |j!dk rÂdd„|j! d¡Dƒ}xV|D]N}t"j #|¡st d|¡n,t|ƒ|kr¬t$|dƒ‚n|j  %t|ƒ¡qpW|j&sÒ| '¡|j(pÜd|_(|j dd…|_)x4|jt|jƒfD] }||j)kr|j) *d|¡qW|j+dk rJdd„|j+ d¡Dƒ}ndg}|j,dkrr|j-|j(|j)|d|_,t.|j)tjƒ|_/|j0dk r¬t1|j0t2ƒr²|j0 ¡|_0ng|_0|j3rÎ|j, 4|j)tj¡|jsä|j, 5|j0¡| dd ¡t1|j6t7ƒs^y0t7|j6ƒ|_6d|j6kr&dks,nt8‚Wn.t8k r\} zt$d!ƒ| ‚Wdd} ~ XYnX|j&rv|j9svt: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)rL)r•rDr7r7r8r¾CsÚ*)Ú search_pathÚhosts)rprpz--optimize must be 0, 1, or 2z9Must specify a build directory (-b) when using --editablez:No urls, filenames, or requirements specified (see --help))=rbr¬r¤ÚsplitrrŽÚget_nameÚ get_versionÚ get_fullnameÚgetattrÚ config_varsrr‚r„r†rcr reÚ_fix_install_dir_for_user_siteÚexpand_basedirsÚ expand_dirsÚ_expandrjrir‡Úset_undefined_optionsryr}r™rr;Ú get_site_dirsÚ all_site_dirsr‹r:rŸrÚappendr]Úcheck_site_dirrlÚ shadow_pathÚinsertrurˆÚ create_indexr#Ú local_indexrmÚ isinstanceÚstrrhZscan_egg_linksÚadd_find_linksrpÚintÚ ValueErrorrnrroÚoutputs) r’rµrwr­r>r‹rTÚ path_itemrÂr^r7r7r8Úfinalize_optionsës°                zeasy_install.finalize_optionscCs\|jr tjsdS| ¡|jdkr.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) rcrr‚Úcreate_home_pathr„r rr€r:ÚnamerMÚ select_scheme)r’ÚmsgZ scheme_namer7r7r8rÉjs  z+easy_install._fix_install_dir_for_user_sitecCs\xV|D]N}t||ƒ}|dk rtjdks0tjdkr}ztt|ƒƒ|‚Wdd}~XYn2tk rn}zt| ¡ƒ|‚Wdd}~XYnX|js€|jr¬x*|D]"}|j|jkr†| | ¡¡q†Wt  d|¡dS)Nzdependency_links.txtzSkipping dependencies for %szProcessing dependencies for %sz'Finished processing dependencies for %s)Ú update_pthrˆÚaddrÕr+Úremover%rŒr rÚinstallation_reportÚ has_metadatar‡rØÚget_metadata_linesrrreÚas_requirementr$r×r(Úresolver/r)rr*ÚreportrŠ)r’Ú requirementrªr7rZdistreqZdistrosr^r7r7r8r5ÓsB              z!easy_install.process_distributioncCs2|jdk r|j S| d¡r dS| d¡s.dSdS)Nz not-zip-safeTzzip-safeF)rgrE)r’rªr7r7r8Ú should_unzipüs   zeasy_install.should_unzipcCs¶tj |j|j¡}tj |¡r:d}t ||j|j|¡|Stj |¡rL|}nRtj  |¡|krft  |¡t  |¡}t |ƒdkržtj ||d¡}tj |¡rž|}t |ƒt ||¡|S)Nz<%r already exists in %s; build directory %s will not be keptrr)r:r;rÿrnr+r<r rerŸrr¡Úlistdirrðr ÚshutilÚmove)r’röÚ dist_filenameÚ setup_baseÚdsträÚcontentsr7r7r8Ú maybe_moves"       zeasy_install.maybe_movecCs0|jr dSx t ¡ |¡D]}|j|ŽqWdS)N)rkÚ ScriptWriterÚbestÚget_argsÚ write_script)r’rªror7r7r8r#sz$easy_install.install_wrapper_scriptscCsNt| ¡ƒ}t||ƒ}|r8| |¡tƒ}t |¡|}| |t|ƒd¡dS)z/Generate a legacy script wrapper and install itrYN) r×rGÚis_python_scriptÚ_load_templater§rTÚ get_headerrWrE)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¢zutf-8)rMrÚdecode)r\râZ raw_bytesr7r7r8rY,s   zeasy_install._load_templateÚtr7c s¦ˆ ‡fdd„|Dƒ¡t d|ˆj¡tj ˆj|¡}ˆ |¡ˆjrLdSt ƒ}t |ƒtj  |¡rpt  |¡t |d|ƒ}| |¡WdQRXt|d|ƒdS)z1Write an executable file to the scripts directorycsg|]}tj ˆj|¡‘qSr7)r:r;rÿrj)r•rU)r’r7r8r¾>sz-easy_install.write_script..zInstalling %s script to %sNriÿ)rœr rrjr:r;rÿr)ržÚ current_umaskr r<r¡r rÚchmod)r’r$rRÚmoder›ÚtargetÚmaskrXr7)r’r8rW;s   zeasy_install.write_scriptc CsT|j|j|jdœ}y|| ¡dd…}Wntk r>YnX|||ƒgS|}tj |¡rv| d¡svt |||j ƒntj  |¡rŽtj  |¡}|  |¡r´|jr´|dk r´| |||¡}tj |d¡}tj |¡s&ttj |dd¡ƒ}|sütdtj  |¡ƒ‚t|ƒdkrtdtj  |¡ƒ‚|d }|jrDt | ||¡¡gS| ||¡SdS) N)z.eggz.exez.whléüÿÿÿz.pyzsetup.pyrÀz"Couldn't find a setup script in %srzMultiple setup scripts in %sr)Ú install_eggÚ install_exeÚ install_wheelrÚKeyErrorr:r;Úisfiler9rÚunpack_progressrŸÚabspathÚ startswithrnrSrÿr<rrrðr]r rÚreport_editableÚbuild_and_install) r’rörOr/Z installer_mapZ install_distrPÚ setup_scriptZsetupsr7r7r8r;OsB     zeasy_install.install_eggscCs>tj |¡r"t|tj |d¡ƒ}ntt |¡ƒ}tj ||dS)NzEGG-INFO)Úmetadata) r:r;rŸr&rÿr'Ú zipimportÚ zipimporterr%Ú from_filename)r’Úegg_pathrqr7r7r8r<‚s    zeasy_install.egg_distributionc CsŽtj |jtj |¡¡}tj |¡}|js2t|ƒ| |¡}t ||ƒsztj  |¡rrtj  |¡srt j ||jdn"tj |¡r”| tj|fd|¡yÀd}tj  |¡rÌ| |¡r¾tjd}}n tjd}}nL| |¡rî| |¡|jd}}n*d}| |¡r tjd}}n tjd}}| |||f|dtj |¡tj |¡f¡t||d Wn$tk rxt|dd ‚YnX| |¡| |¡S) N)ržz Removing FZMovingZCopyingZ ExtractingTz %s to %s)Úfix_zipimporter_caches)r:r;rÿrirrlržr r<r.rŸr”r Ú remove_treer<rór¡rmrMrNÚcopytreerKÚmkpathÚunpack_and_compileÚcopy2rÚupdate_dist_cachesrûr))r’rur/Ú destinationrªZnew_dist_is_zippedrXrQr7r7r8rf‹sT               zeasy_install.install_eggc sTt|ƒ}|dkrtd|ƒ‚td| dd¡| dd¡tƒd}tj || ¡d¡}||_ |d}tj |d¡}tj |d ¡}t |ƒt ||ƒ|_ |  ||¡tj |¡st|d ƒ} |  d ¡x<| d¡D].\} } | d krÌ|  d |  dd¡ ¡| f¡qÌW|  ¡tj |d¡‰| ‡fdd„t |¡Dƒ¡tj|||j|jd| ||¡S)Nz(%s is not a valid distutils Windows .exerqrârb)r:rbÚplatformz.eggz.tmpzEGG-INFOzPKG-INFOrzMetadata-Version: 1.0 Útarget_versionz%s: %s Ú_ú-rcsg|]}tj ˆ|d¡‘qS)r)r:r;rÿ)r•ro)rjr7r8r¾äsz,easy_install.install_exe..)rrž)r1rr%r rr:r;rÿÚegg_namer6r r&Ú _providerÚ exe_to_eggr<r rÚitemsrMÚtitler rœrTrVrÚ make_zipfilerržrf) r’rOr/ÚcfgrªruÚegg_tmpZ _egg_infoZpkg_infrXÚkÚvr7)rjr8rgÁs<      " zeasy_install.install_exec s>t|ƒ‰g‰g‰i‰‡‡‡‡‡fdd„}t|ˆ|ƒg}xtˆD]l}| ¡ d¡r>| d¡}|d}t |d¡d|d<tjj ˆf|žŽ}ˆ  |¡|  |¡t  ||¡q>W|  ˆ¡t  tj  ˆd¡t ˆ|¡¡xbdD]Z} tƒ| rÜtj  ˆd| d ¡} tj | ¡sÜt| d ƒ} |  d   tƒ| ¡d ¡|  ¡qÜWd S) z;Extract a bdist_wininst to the directories an egg would usecsø| ¡}xÔˆD]Ì\}}| |¡r||t|ƒd…}| d¡}tjjˆf|žŽ}| ¡}| d¡sl| d¡r¢t  |d¡|d<dˆtj  |d¡d<ˆ  |¡n4| d¡rÖ|dkrÖdˆtj  |d¡d<ˆ  |¡|SqW| d ¡sôt   d |¡dS) Nú/z.pydz.dlléÿÿÿÿrrz.pyzSCRIPTS/z.pthzWARNING: can't process %s)rrmrðrÃr:r;rÿr9rÚ strip_moduleÚsplitextrÐr re)ÚsrcrQrDÚoldÚnewÚpartsr8)r‰Ú native_libsÚprefixesÚ to_compileÚ top_levelr7r8Úprocess÷s$      z(easy_install.exe_to_egg..processz.pydrŒrz.pyzEGG-INFO)r—r”z.txtrrIN)r2rrr9rÃrrŽr:r;rÿrÐZ write_stubÚ byte_compileZwrite_safety_flagZ analyze_eggr§r<r rr ) r’rOr‰r˜ZstubsÚresr“ÚresourceZpyfilerâÚtxtrXr7)r‰r”r•r–r—r8r„ïs6           zeasy_install.exe_to_eggc Csàt|ƒ}| ¡st‚tj |j| ¡¡}tj |¡}|j sBt |ƒtj  |¡rltj  |¡slt j||j dn"tj |¡rŽ| tj|fd|¡z.| |j|fdtj |¡tj |¡f¡Wdt|ddX| |¡| |¡S)N)ržz Removing zInstalling %s to %sF)rv)rÚ is_compatibleÚAssertionErrorr:r;rÿrir‚rlržr rŸr”r rwr<rór¡Zinstall_as_eggrrr|r)r<)r’Ú wheel_pathr/Úwheelr}r7r7r8rh$s.      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ƒkr>|d|j7}|j }|j }|j }d}|t ƒS)z9Helpful installation message for display to package usersz %(what)s %(eggloc)s%(extras)srIr±) rsrxÚ_easy_install__mv_warningrir™rr¤r;Ú_easy_install__id_warningr6r:rbr§) r’ÚreqrªÚwhaträZegglocrârbÚextrasr7r7r8rDRs 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örprÚpythonr7r7r8rnks zeasy_install.report_editablec Csætj dt¡tj dt¡t|ƒ}|jdkrNd|jd}| dd|¡n|jdkrd| dd¡|jrv| dd ¡t   d |t |ƒdd…d   |¡¡yt ||ƒWn8tk rà}ztd |jdfƒ|‚Wdd}~XYnXdS) Nzdistutils.command.bdist_eggzdistutils.command.egg_infor¯r‹rrrz-qz-nz Running %s %sú zSetup script exited with %s)r¤ÚmodulesÚ setdefaultrrr˜rrÓržr rrðrÿrr¨rro)r’rprPror‹r7r7r8rps$     zeasy_install.run_setupc CsÀddg}tjdtj |¡d}z†| tj |¡¡| |¡| |||¡t|gƒ}g}x2|D]*}x$||D]}| |  |j |¡¡qlWq^W|s¢|j s¢t   d|¡|St|ƒt  |j¡XdS)Nrz --dist-dirz egg-dist-tmp-)rwÚdirz+No eggs found in %s (setup script problem?))r-r.r:r;rÚ_set_fetcher_optionsrÐrr#rfr6ržr rer rïr) r’rprProÚdist_dirZall_eggsÚeggsr+rªr7r7r8ro†s$    zeasy_install.build_and_installc Csl|j d¡ ¡}d}i}x*| ¡D]\}}||kr4q"|d||<q"Wt|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/)rmr‹rlrprur)r/z setup.cfgN) rŽr‘Úcopyr…Údictr:r;rÿrZ edit_config) r’r'Zei_optsZfetch_directivesZ fetch_optionsr+réÚsettingsZ cfg_filenamer7r7r8r­žs  z!easy_install._set_fetcher_optionsc Cs:|jdkrdSxZ|j|jD]J}|js4|j|jkr4qt d|¡|j |¡|j|jkr|j |j¡qW|js¾|j|jjkrŒt d|¡n2t d|¡|j  |¡|j|jkr¾|j  |j¡|j rÈdS|j  ¡|jdkràdSt j |jd¡}t j |¡rt  |¡t|dƒ}| |j |j¡d¡WdQRXdS)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¢zsetuptools.pthÚwtrI)r‰r+rsr6r rrCrÒÚpathsrBrÐržÚsaver:r;rÿrir”r¡r rÚ make_relative)r’rªrTr–rXr7r7r8rAµs8           zeasy_install.update_pthcCst d||¡|S)NzUnpacking %s to %s)r Údebug)r’rrQr7r7r8rkÞszeasy_install.unpack_progresscshg‰g‰‡‡‡fdd„}t|||ƒˆ ˆ¡ˆjsdx.ˆD]&}t |¡tjdBd@}t||ƒq:WdS)NcsZ| d¡r | d¡s ˆ |¡n| d¡s4| d¡r>ˆ |¡ˆ ||¡ˆj rV|pXdS)Nz.pyz EGG-INFO/z.dllz.so)r9rmrÐrkrž)rrQ)r’Úto_chmodr–r7r8Úpfçs    z+easy_install.unpack_and_compile..pfimií)rr™ržr:ÚstatÚST_MODEra)r’rur}r¹rXrbr7)r’r¸r–r8rzãs   zeasy_install.unpack_and_compilec Csjtjr dSddlm}z@t |jd¡||dd|jd|jrT|||jd|jdWdt |j¡XdS)Nr)r™r)rpÚforcerž) r¤Údont_write_bytecodeÚdistutils.utilr™r rïrržrp)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. cCsf|js dSttj d¡ƒ}xF|j ¡D]8\}}| |¡r&tj |¡s&|  d|¡t  |d¡q&WdS)zCreate directories under ~.Nú~zos.makedirs('%s', 0o700)iÀ) rcrr:r;r½rÈr…rmrŸÚ debug_printr)r’Úhomerâr;r7r7r8rá)szeasy_install.create_home_pathz/$base/lib/python$py_version_short/site-packagesz $base/bin)rirj)rÞz$base/Lib/site-packagesz $base/ScriptscGsÄ| d¡j}|jrh| ¡}|j|d<|j tj|j¡}x0|  ¡D]$\}}t ||dƒdkr@t |||ƒq@Wddl m }xJ|D]B}t ||ƒ}|dk rz|||ƒ}tjdkr°tj |¡}t |||ƒqzWdS)Nr¼r'r)rrÞ)Úget_finalized_commandrÈrwr°r r r:râÚDEFAULT_SCHEMEr…rÇrær¾rr;r½)r’rçrÈr?rèrérr7r7r8rÌ?s         zeasy_install._expand)T)F)F)T)N)r_r7)r¡)MÚ__name__Ú __module__Ú __qualname__Ú__doc__Ú descriptionZcommand_consumes_argumentsrr…Ú user_optionsÚboolean_optionsÚ negative_optrrÔr“rœršÚ staticmethodr¬rÝrÉrêrÊrËrùrrõrÑrJrKÚlstriprrrrrr%r)r*r,Ú contextlibÚcontextmanagerr0r/r3rãr5rKrSr#r!rYrWr;r<rfrgr„rhr¢r£rDr§rnrror­rArkrzr™rLr rár±r rÃrÌr7r7r7r8r/nsÆ 5    -    ;  ! $ (   3 6.5   )   cCs tj dd¡ tj¡}td|ƒS)Nrr±)r:r r rÃÚpathsepÚfilter)r…r7r7r8Ú _pythonpathVsrÒc s|g‰ˆ tƒ¡tjg}tjtjkr0| tj¡xØ|D]Ð}|s@q6tjdkrbˆ tj  |dd¡¡nVtj dkržˆ tj  |ddj tj Žd¡tj  |dd¡g¡nˆ |tj  |dd¡g¡tjdkrÄq6d |krÎq6tj  d ¡}|sàq6tj  |d d d j tj Žd¡}ˆ |¡q6Wtdƒtdƒf}ˆ ‡fdd„|Dƒ¡tjrFˆ tj¡t t¡ˆ t ¡¡WdQRXtttˆƒƒ‰ˆS)z& Return a list of 'site' dirs )Zos2emxZriscosÚLibz site-packagesrŒÚlibz python{}.{}z site-pythonÚdarwinzPython.frameworkÚHOMEÚLibraryÚPythonz{}.{}ÚpurelibÚplatlibc3s|]}|ˆkr|VqdS)Nr7)r•rD)Úsitedirsr7r8r—”sz get_site_dirs..N)ÚextendrÒr¤rwr­rÐr~r:r;rÿÚsepr£r¥r r rrr‚r…rÎÚsuppressÚAttributeErrorÚgetsitepackagesr˜r™r)r•rwrÁZhome_spZ lib_pathsr7)rÛr8rÎ[sV            rÎccsòi}xè|D]à}t|ƒ}||kr q d||<tj |¡s6q t |¡}||fVxž|D]–}| d¡s`qP|dkrjqPttj ||¡ƒ}tt |ƒƒ}|  ¡xT|D]L}|  d¡r¦q–t|  ¡ƒ}||kr¼q–d||<tj |¡sÒq–|t |¡fVq–WqPWq WdS)zBYield sys.path directories that might contain "old-style" packagesrz.pth)zeasy-install.pthzsetuptools.pthÚimportN) rr:r;rŸrLr9r rÿr˜rr rmÚrstrip)ÚinputsÚseenrr(rârXÚlinesÚliner7r7r8Ú expand_paths¡s8           rçc Cs"t|dƒ}zt |¡}|dkr$dS|d|d|d}|dkrHdS| |d¡t d| d¡¡\}}}|dkrzdS| |d|¡d d d œ}t |¡}y<| |¡} |   d d ¡d } |   t   ¡¡} |  t | ¡¡Wntjk ròdSX| d¡r | d¡sdS|S| ¡XdS)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±)zSCRIPTS/zEGG-INFO/scripts/)zDATA/lib/site-packagesr±rŒr®r¯zPKG-INFOrz .egg-inforNz EGG-INFO/z.pthz -nspkg.pth)ZPURELIBZPLATLIBú\ráz%s/%s/r±cSsg|]\}}| ¡|f‘qSr7)r)r•rUÚyr7r7r8r¾sz$get_exe_prefixes..)rîÚZipFileÚinfolistr–rÃrðr9rÓrÿÚupperròr^rrLrMrmrÐr ÚsortÚreverse)Z exe_filenamer•rPrrâr“rRÚpthr7r7r8r2øs:    & c@sReZdZdZdZddd„Zdd„Zdd „Zed d „ƒZ d d „Z dd„Z dd„Z dS)r0z)A .pth file with Distribution paths in itFr7cCsp||_ttt|ƒƒ|_ttj |j¡ƒ|_|  ¡t   |gdd¡x(t |j ƒD]}tt|jt|dƒƒƒqNWdS)NT)r–r˜r™rrÛr:r;rÚbasedirÚ_loadr#Ú__init__rr´rBr")r’r–rÛr;r7r7r8r "szPthDistributions.__init__cCs g|_d}t |j¡}tj |j¡rÎt|jdƒ}x”|D]Œ}|  d¡rJd}q6|  ¡}|j  |¡|  ¡r6|  ¡  d¡rvq6t tj |j|¡ƒ}|jd<tj |¡r¨||krº|j ¡d|_q6d||<q6W| ¡|jrÞ|sÞd|_x&|jr|jd  ¡s|j ¡qàWdS)NFÚrtráTú#rr)r´r±ÚfromkeysrÛr:r;rjr–r rmrârÐrLrrÿrr<ÚpopÚdirtyr )r’Z saw_importrärXrær;r7r7r8r +s2        zPthDistributions._loadc Cs¶|js dStt|j|jƒƒ}|r„t d|j¡| |¡}d  |¡d}t j   |j¡r`t   |j¡t|jdƒ}| |¡WdQRXn(t j  |j¡r¬t d|j¡t   |j¡d|_dS)z$Write changed .pth file back to diskNz Saving %srIr³zDeleting empty %sF)rr˜r™r¶r´r r·r–Ú _wrap_linesrÿr:r;r”r¡r rr<)r’Z rel_pathsråÚdatarXr7r7r8rµJs   zPthDistributions.savecCs|S)Nr7)rår7r7r8r`szPthDistributions._wrap_linescCsN|j|jko$|j|jkp$|jt ¡k}|r>|j |j¡d|_t ||¡dS)z"Add `dist` to the distribution mapTN) r6r´rÛr:ÚgetcwdrÐrr#rB)r’rªÚnew_pathr7r7r8rBds  zPthDistributions.addcCs6x$|j|jkr$|j |j¡d|_qWt ||¡dS)z'Remove `dist` from the distribution mapTN)r6r´rCrr#)r’rªr7r7r8rCrs zPthDistributions.removecCs”tj t|ƒ¡\}}t|jƒ}|g}tjdkr2dp6tj}xVt|ƒ|krŠ||jkrn| tj ¡|  ¡|  |¡Stj |¡\}}| |¡q:W|SdS)NrŒ) r:r;rÃrrðrÚaltseprÝrÐÚcurdirrrÿ)r’r;ÚnpathÚlastZbaselenr“rÝr7r7r8r¶ys    zPthDistributions.make_relativeN)r7) rÄrÅrÆrÇrr r rµrÌrrBrCr¶r7r7r7r8r0s  c@s(eZdZedd„ƒZedƒZedƒZdS)ÚRewritePthDistributionsccs(|jVx|D] }|VqW|jVdS)N)Ú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ÆÚ classmethodrrOrrr7r7r7r8r‰s  rZSETUPTOOLS_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Úcompiler^r7r7r7r8Ú_first_line_re£s r!cCs\|tjtjgkr.tjdkr.t|tjƒ||ƒSt ¡\}}}|d|dd||ff‚dS)Nrårrz %s %s) r:r¡rCrârarºÚS_IWRITEr¤r)ÚfuncÚargÚexcÚetZevr€r7r7r8Ú auto_chmod¯s  r'cCs.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_pathrvÚnormalized_pathr7r7r8r|¸s <  r|cCsTg}t|ƒ}xB|D]:}t|ƒ}| |¡r|||d…tjdfkr| |¡qW|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ðrrmr:rÝrÐ)r-ÚcacheÚresultÚ prefix_lenÚpÚnpr7r7r8Ú"_collect_zipimporter_cache_entries s   r3cCsDx>t||ƒD]0}||}||=|o*|||ƒ}|dk r |||<q WdS)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)r3)r-r.Úupdaterr1Ú old_entryZ new_entryr7r7r8Ú_update_zipimporter_caches  r6cCst||ƒdS)N)r6)r-r.r7r7r8r(>sr(cCsdd„}t|tj|ddS)NcSs | ¡dS)N)Úclear)r;r5r7r7r8Ú2clear_and_remove_cached_zip_archive_directory_dataCszf_remove_and_clear_zip_directory_cache_data..clear_and_remove_cached_zip_archive_directory_data)r4)r6rrÚ_zip_directory_cache)r-r8r7r7r8r+Bsr+Z__pypy__cCsdd„}t|tj|ddS)NcSs&| ¡t |¡| tj|¡|S)N)r7rrrsÚupdater9)r;r5r7r7r8Ú)replace_cached_zip_archive_directory_dataYs zT_replace_zip_directory_cache_data..replace_cached_zip_archive_directory_data)r4)r6rrr9)r-r;r7r7r8r*Xs r*úc Cs2yt||dƒWnttfk r(dSXdSdS)z%Is this string a valid Python script?ÚexecFTN)r Ú SyntaxErrorÚ TypeError)rNr–r7r7r8Ú is_pythonks r@c CsJy(tj|dd}| d¡}WdQRXWnttfk r@|SX|dkS)zCDetermine if the specified executable is a .sh (contains a #! line)zlatin-1)Úencodingr¯Nz#!)r÷r ròrr)rÚfpÚmagicr7r7r8Úis_shus rDcCs t |g¡S)z@Quote a command line argument according to Windows parsing rules)Ú subprocessÚ list2cmdline)r$r7r7r8Ú nt_quote_argsrGcCsH| d¡s| d¡rdSt||ƒr&dS| d¡rDd| ¡d ¡kSdS)zMIs this text, as a whole, a Python script? (as opposed to shell/bat/etc. z.pyz.pywTz#!r¨rF)r9r@rmÚ splitlinesr)r[r–r7r7r8rX„s  rX)racGsdS)Nr7)ror7r7r8Ú_chmod–srIc CsRt d||¡yt||ƒWn0tjk rL}zt d|¡Wdd}~XYnXdS)Nzchanging mode of %s to %ozchmod failed: %s)r r·rIr:Úerror)r;rbr^r7r7r8rašs rac@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. cCs|S)zV Choose the best CommandSpec class based on environmental conditions. r7)rr7r7r8rU«szCommandSpec.bestcCstj tj¡}tj d|¡S)NÚ__PYVENV_LAUNCHER__)r:r;r>r¤rr r )rÚ_defaultr7r7r8Ú_sys_executable²szCommandSpec._sys_executablecCs:t||ƒr|St|tƒr ||ƒS|dkr0| ¡S| |¡S)zg Construct a CommandSpec from a parameter to build_scripts, which may be None. N)rÖr˜Úfrom_environmentÚ from_string)rÚparamr7r7r8Ú from_param·s  zCommandSpec.from_paramcCs|| ¡gƒS)N)rN)rr7r7r8rOÆszCommandSpec.from_environmentcCstj|f|jŽ}||ƒS)z} Construct a command spec from a simple string representing a command line parseable by shlex.split. )ÚshlexrÃÚ split_args)rÚstringr…r7r7r8rPÊszCommandSpec.from_stringcCs8t | |¡¡|_t |¡}t|ƒs4dg|jdd…<dS)Nz-xr)rSrÃÚ_extract_optionsÚoptionsrErFrH)r’r[Ú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. rIrrr±)rHr!ÚmatchÚgrouprL)Z orig_scriptÚfirstrZrWr7r7r8rVÙs zCommandSpec._extract_optionscCs| |t|jƒ¡S)N)Ú_renderr˜rW)r’r7r7r8Ú as_headerãszCommandSpec.as_headercCs6d}x,|D]$}| |¡r | |¡r |dd…Sq W|S)Nz"'rr)rmr9)ÚitemZ_QUOTESÚqr7r7r8Ú _strip_quotesæs  zCommandSpec._strip_quotescCs t dd„|Dƒ¡}d|dS)Ncss|]}t | ¡¡VqdS)N)rKrarL)r•r_r7r7r8r—ñsz&CommandSpec._render..z#!rI)rErF)r…rXr7r7r8r]îszCommandSpec._renderN)rÄrÅrÆrÇrWr±rTrrUrNrRrOrPrYrÌrVr^rar]r7r7r7r8rK¢s       rKc@seZdZeddZdS)ÚWindowsCommandSpecF)rÞN)rÄrÅrÆr±rTr7r7r7r8rbùsrbc@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)rTz` 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±)rdrerfÚWindowsScriptWriterrTrUÚget_script_headerrV)rrªrÚwininstÚwriterÚheaderr7r7r8Úget_script_args(s zScriptWriter.get_script_argscCs$tjdtdd|rd}| ||¡S)NzUse get_headerr¯)Ú stacklevelz python.exe)rdrerfrZ)rr[rrer7r7r8rd0s  zScriptWriter.get_script_headerc csŒ|dkr| ¡}t| ¡ƒ}xjdD]b}|d}xT| |¡ ¡D]B\}}| |¡|jtƒ}| ||||¡} x| D] } | VqrWq>Wq"WdS)z Yield write_script() argument tuples for a distribution's console_scripts and gui_scripts entry points. N)ÚconsoleÚguiZ_scripts) rZr×rGÚ get_entry_mapr…Ú_ensure_safe_nameÚtemplater§Ú_get_script_args) rrªrgröÚtype_r[râÚepr[roršr7r7r8rV9s     zScriptWriter.get_argscCst d|¡}|rtdƒ‚dS)z? Prevent paths in *_scripts entry point names. z[\\/]z+Path separators not allowed in script namesN)rÚsearchrÚ)râZ has_path_sepr7r7r8rmKs zScriptWriter._ensure_safe_namecCs t dt¡|rt ¡S| ¡S)NzUse best)rdrerfrcrU)rZ force_windowsr7r7r8Ú get_writerTs zScriptWriter.get_writercCs.tjdkstjdkr&tjdkr&t ¡S|SdS)zD Select the best ScriptWriter for this environment. Úwin32ÚjavaråN)r¤r~r:râÚ_namercrU)rr7r7r8rUZszScriptWriter.bestccs|||fVdS)Nr7)rrprârgr[r7r7r8rodszScriptWriter._get_script_argsr±cCs"|j ¡ |¡}| |¡| ¡S)z;Create a #! line, getting options (if any) from script_text)Úcommand_spec_classrUrRrYr^)rr[rÚcmdr7r7r8rZis zScriptWriter.get_header)NF)NF)N)r±N)rÄrÅrÆrÇrJrKrÍrnrKrwrrhrdrVrÌrmrsrUrorZr7r7r7r8rTýs !      rTc@sLeZdZeZedd„ƒZedd„ƒZedd„ƒZedd„ƒZ e d d „ƒZ d S) rccCst dt¡| ¡S)NzUse best)rdrerfrU)rr7r7r8rsts zWindowsScriptWriter.get_writercCs"tt|d}tj dd¡}||S)zC Select the best ScriptWriter suitable for Windows )rZnaturalZSETUPTOOLS_LAUNCHERr)r±ÚWindowsExecutableLauncherWriterr:r r )rZ writer_lookupÚlauncherr7r7r8rUzs zWindowsScriptWriter.bestc #s–tddd|}|tjd ¡ d¡krBdjftƒŽ}t |t ¡dddd d dd g}|  |¡|  ||¡}‡fd d „|Dƒ}ˆ|||d|fVdS)z For Windows, add a .py extensionz.pyaz.pyw)rjrkÚPATHEXTú;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.z.pyz -script.pyz.pycz.pyoz.execsg|] }ˆ|‘qSr7r7)r•rU)râr7r8r¾”sz8WindowsScriptWriter._get_script_args..r_N) r±r:r rrÃr£r§rdreÚ UserWarningrCÚ_adjust_header) rrprârgr[Úexträr‘r›r7)râr8ro‡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). z pythonw.exez python.exerk)rUÚrepl)rr ÚescapeÚ IGNORECASEÚsubÚ _use_header)rrpZ orig_headerrr€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ú"rt)rLr¤r~r)r…Z clean_headerr7r7r8r„¥s zWindowsScriptWriter._use_headerN) rÄrÅrÆrbrwrrsrUror~rÌr„r7r7r7r8rcqs    rcc@seZdZedd„ƒZdS)ryc #s”|dkrd}d}dg}nd}d}dddg}| ||¡}‡fd d „|Dƒ} ˆ|||d | fVˆd t|ƒd fVtƒsˆd} | tˆƒd fVdS)zG For Windows, add a .py extension and an .exe launcher rkz -script.pywz.pywÚcliz -script.pyz.pyz.pycz.pyocsg|] }ˆ|‘qSr7r7)r•rU)râr7r8r¾ÁszDWindowsExecutableLauncherWriter._get_script_args..r_z.exerYz .exe.manifestN)r~Úget_win_launcherr9Úload_launcher_manifest) rrprârgr[Z launcher_typerr‘Úhdrr›Zm_namer7)râr8ro³s   z0WindowsExecutableLauncherWriter._get_script_argsN)rÄrÅrÆrror7r7r7r8ry²srycCsJd|}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¢)r9rrMr)ÚtypeZ launcher_fnr7r7r8rˆÖs  rˆcCst td¡}| d¡tƒS)Nzlauncher manifest.xmlzutf-8)Ú pkg_resourcesrrÄr^Úvars)râÚmanifestr7r7r8r‰és r‰FcCst |||¡S)N)rMr )r;Ú ignore_errorsÚonerrorr7r7r8r îsr cCst d¡}t |¡|S)Né)r:Úumask)Útmpr7r7r8r`òs  r`c@seZdZdZdS)rfzF Warning for EasyInstall deprecations, bypassing suppression. N)rÄrÅrÆrÇr7r7r7r8rføsrf)N)r<)|rÇrr¾rrrÚdistutils.errorsrrrr Údistutils.command.installr r ròr r Zdistutils.command.build_scriptsrrrr¤r:rrrMr-rîrrºrürJrdrr5rÎrErSr÷róÚ sysconfigrrr¢rrZsetuptools.sandboxrZsetuptools.commandrZsetuptools.archive_utilrZsetuptools.package_indexrrrrrZsetuptools.wheelrrrrrr r!r"r#r$r%r&r'r(r)r*r+ÚfilterwarningsÚ PEP440WarningÚ__all__r9r.rErHrOr/rÒrÎrçr1r2r0rr r r!r'r|r3r6r(r+Úbuiltin_module_namesr*r@rDrGrXrarIÚ ImportErrorr˜rKrNZsys_executablerbrTrcryrhrdrˆr‰r r`rfr7r7r7r8Ú sÀ          DqF.)%l  R    TtA