Ë  ¸…bà>ÑHãóV—dZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z m Z ddl mZddlmZddlmZd„Zd „Zej(d k(rdad Zd „Zd „Zd„Zd„Zd„Zd„Ze j:«d„«Zd„Zd„Z dd„Z!dxa"xa#a$d„Z%d„Z&dd„Z'd„Z( dd„Z)d„Z*y)zudistutils.util Miscellaneous utility functions -- anything that doesn't fit into one of the other *util.py modules. éNé)ÚDistutilsPlatformErrorÚDistutilsByteCompileError)Únewer)Úspawn)ÚlogcóÊ—tjdkrUtjdk(rBdtjj «vrydtjj «vrytjdkrUtjdk(rBt td «r2tj«\}}}}}|d d d k(rd dlm }||||«Stj«S)z· Return a string that identifies the current platform. Use this function to distinguish platform-specific build directories and platform-specific built distributions. )ééÚntz(arm)ú win-arm32z(arm64)ú win-arm64)r é ÚposixÚunameNr Úaixr)Ú aix_platform) ÚsysÚ version_infoÚosÚnameÚversionÚlowerÚhasattrrÚ py38compatrÚ sysconfigÚ get_platform)ÚosnameÚhostÚreleaserÚmachiners ú?/usr/lib/python3.12/site-packages/setuptools/_distutils/util.pyÚget_host_platformr#sµ€ô ×ј&Ò Ü �7‰7�dŠ?Øœ#Ÿ+™+×+Ñ+Ó-Ñ-Ø"ØœCŸK™K×-Ñ-Ó/Ñ/Ø"ä ×ј&Ò Ü �7‰7�gÒ ¤'¬"¨gÔ"6Ü68·h±h³jÑ 3ˆF�D˜' 7¨GØ�b�qˆz˜UÒ"Ý4á# F¨G°WÓ=Ð=ä × !Ñ !Ó #Ð#ócó—tjdk(rCdddddœ}tjjd«}|j|«xs t «St «S)Nr Úwin32z win-amd64r r)Úx86Úx64ÚarmÚarm64ÚVSCMD_ARG_TGT_ARCH)rrÚenvironÚgetr#)ÚTARGET_TO_PLATÚtargets r"rr3sX€Ü ‡w�w�$‚àØØØ ñ  ˆô —‘—‘Ð 4Ó5ˆØ×!Ñ! &Ó)Ò@Ô->Ó-@Ð@Ü Ó Ðr$ÚdarwinÚMACOSX_DEPLOYMENT_TARGETcó—day)zFor testing only. Do not call.N)Ú_syscfg_macosx_ver©r$r"Ú_clear_cached_macosx_verr5Es €ðÑr$cób—t€$ddlm}|jt«xsd}|r|atS)z’Get the version of macOS latched in the Python interpreter configuration. Returns the version as a string or None if can't obtain one. Cached.r)rÚ)r3Ú distutilsrÚget_config_varÚMACOSX_VERSION_VAR)rÚvers r"Ú!get_macosx_target_ver_from_syscfgr<Ks4€ôÐ!Ý'à&ˆi×&Ñ&Ô'9Ó:Ò@¸bˆÙ Ø!$Ð Ü Ðr$cóè—t«}tjjt«}|rB|r>t |«ddgk\r.t |«ddgkrdtzd|›d|›d�z}t |«‚|S|S)aReturn the version of macOS for which we are building. The target version defaults to the version in sysconfig latched at time the Python interpreter was built, unless overridden by an environment variable. If neither source has a value, then None is returnedé r Ú$z mismatch: now "z" but "z*" during configure; must use 10.3 or later)r<rr,r-r:Ú split_versionr)Ú syscfg_verÚenv_verÚmy_msgs r"Úget_macosx_target_verrDXs‚€ô3Ó4€JÜ�j‰j�n‰nÔ/Ó0€Gáñ ܘjÓ)¨b°!¨WÒ4ܘgÓ&¨"¨a¨Ò0ðÔ(Ò(â,3²Zð,AñAð ô )¨Ó0Ð 0ØˆØ Ðr$có\—|jd«D�cgc] }t|«‘Œc}Scc}w)zEConvert a dot-separated string into a list of numbers for comparisonsÚ.)ÚsplitÚint)ÚsÚns r"r@r@xs&€àŸG™G CœLÓ )™L�qŒC��F˜LÑ )Ð)ùÒ )s”)có>—tjdk(r|S|s|S|ddk(rtd|z«‚|ddk(rtd|z«‚|jd«}d|vr|j d«d|vrŒ|stj Stj j|ŽS)aÎReturn 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. Ú/rzpath '%s' cannot be absoluteéÿÿÿÿzpath '%s' cannot end with '/'rF)rÚsepÚ ValueErrorrGÚremoveÚcurdirÚpathÚjoin)ÚpathnameÚpathss r"Ú convert_pathrV}s €ô ‡v�v�‚}؈٠؈Ø��{�cÒÜÐ7¸(ÑBÓCÐCØ��|�sÒÜÐ8¸8ÑCÓDÐDà �N‰N˜3Ó €EØ �‰,Ø � ‰ �SÔð �Š,á Ü�y‰yÐÜ �7‰7�<‰<˜Ð Ðr$cóê—tjdk(rbtjj|«s tjj ||«Stjj ||dd«Stjdk(rOtjj |«\}}|ddk(r|dd}tjj ||«St dtj›d�«‚) a Return 'pathname' with 'new_root' prepended. If 'pathname' is relative, this is equivalent to "os.path.join(new_root,pathname)". Otherwise, it requires making 'pathname' relative and then joining the two, which is tricky on DOS/Windows and Mac OS. rrNr rÚ\znothing known about platform 'Ú')rrrRÚisabsrSÚ splitdriver)Únew_rootrTÚdriverRs r"Ú change_rootr^šs·€ô  ‡w�w�'ÒÜ�w‰w�}‰}˜XÔ&Ü—7‘7—<‘< ¨(Ó3Ð 3ä—7‘7—<‘< ¨(°1°2¨,Ó7Ð 7ä �‰�DŠÜŸ™×*Ñ*¨8Ó4‰ ˆ�Ø �‰7�dŠ?ؘ˜�8ˆDÜ�w‰w�|‰|˜H dÓ+Ð+ä Ð#AÄ"Ç'Á'ÀÈ!Ð!LÓ MÐMr$cóL—tjdk(rNdtjvr< ddl}|j tj ««dtjd<dtjvrt«tjd<yy#t tf$rYŒ@wxYw)aLEnsure that 'os.environ' has all the environment variables we guarantee that users can use in config files, command-line options, etc. Currently this includes: HOME - user's home directory (Unix only) PLAT - description of the current platform, including hardware and OS (see 'get_platform()') rÚHOMErNéÚPLAT) rrr,ÚpwdÚgetpwuidÚgetuidÚ ImportErrorÚKeyErrorr)rcs r"Ú check_environrh¯sƒ€ô ‡w�w�'Ò˜f¬B¯J©JÑ6ð Û à!$§¡¬b¯i©i«kÓ!:¸1Ñ!=ŒB�J‰J�vÑ ð ”R—Z‘ZÑÜ)›^Œ� ‰ �6Òð øô œXÐ&ò ñ ð ús§;BÂB#Â"B#có—t«ttj«}|j d„|j «D«« t |«j|«S#t$r}td|›�«‚d}~wwxYw)aà Perform variable substitution on 'string'. Variables are indicated by format-style braces ("{var}"). Variable is substituted by the value found in the 'local_vars' dictionary or in 'os.environ' if it's not in 'local_vars'. 'os.environ' is first checked/augmented to guarantee that it contains certain values: see 'check_environ()'. Raise ValueError for any variables not found in either 'local_vars' or 'os.environ'. c3ó<K—|]\}}|t|«f–—Œy­w©N©Ústr)Ú.0rÚvalues r"Ú zsubst_vars..Òs èø€ÐKÑ8J©¨¨u�4œ˜U›Ô$Ñ8Jùs‚zinvalid variable N) rhÚdictrr,ÚupdateÚitemsÚ _subst_compatÚ format_maprgrO)rIÚ local_varsÚlookupÚvars r"Ú subst_varsryÆsp€ô„OÜ ”"—*‘*Ó €FØ ‡M�MÑK¸ ×8HÑ8HÔ8JÓKÔKð4ܘQÓ×*Ñ*¨6Ó2Ð2øÜ ò4ÜÐ,¨S¨EÐ2Ó3Ð3ûð4úsÁ A%Á% BÁ.A<Á<Bcóx—d„}tjd||«}||k7rddl}|jdt«|S)zb Replace shell/Perl-style variable substitution with format-style. For compatibility. có,—d|jd«›d�S)NÚ{rÚ})Úgroup)Úmatchs r"Ú_substz_subst_compat.._substßs€Ø�E—K‘K “NÐ# 2Ð&Ð&r$z\$([a-zA-Z_][a-zA-Z_0-9]*)rNz-shell/Perl-style substitutions are deprecated)ÚreÚsubÚwarningsÚwarnÚDeprecationWarning)rIr€Úreplrƒs r"rtrtÙs?€ò 'ô �6‰6Ð/°¸Ó ;€DØ ˆq‚yÛà� ‰ Ø ;Ü ô ð €Kr$có—|t|«zSrkrl)ÚexcÚprefixs r"Úgrok_environment_errorrŠís€ð ”C˜“HÑ Ðr$có¤—tjdtjz«atjd«atjd«ay)Nz [^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r�ÚcompileÚstringÚ whitespaceÚ _wordchars_reÚ _squote_reÚ _dquote_rer4r$r"Ú _init_regexr’øs:€ä—J‘JÐ/´&×2CÑ2CÑCÓD€MÜ—‘Ð0Ó1€JÜ—‘Ð0Ó1�Jr$có*—t€ t«|j«}g}d}|�rktj||«}|j «}|t |«k(r|j |d|« |S||tjvr*|j |d|«||dj«}d}n»||dk(r|d|||dzdz}|dz}nŸ||dk(rtj||«}n0||dk(rtj||«}ntd||z«‚|€td||z«‚|j«\}}|d|||dz|dz z||dz}|j «d z }|t |«k\r|j |« |S|r�Œk|S) aSplit a string up according to Unix shell-like rules for quotes and backslashes. In short: words are delimited by spaces, as long as those spaces are not escaped by a backslash, or inside a quoted string. Single and double quotes are equivalent, and the quote characters can be backslash-escaped. The backslash is stripped from any two-character escape sequence, leaving only the escaped character. The quote characters are stripped from any quoted string. Returns a list of words. NrrXrrYÚ"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)é)r�r’ÚstriprÚendÚlenÚappendr�rŽÚlstripr�r‘Ú RuntimeErrorrOÚspan)rIÚwordsÚposÚmr—Úbegs r"Ú split_quotedr¡ÿs»€ôÐÜŒ à �‰‹ €AØ €EØ €Câ Ü × Ñ   3Ó 'ˆØ�e‰e‹gˆØ ”#�a“&Š=Ø �L‰L˜˜4˜C˜Ô !Ø ðD €LðA ˆS‰6”V×&Ñ&Ñ &ð �L‰L˜˜4˜C˜Ô !Ø�#�$�—‘Ó ˆA؉Cà ˆs‰V�tŠ^ð�$�3�˜!˜C !™G˜I˜,Ñ&ˆAؘ‘'‰Cð�‰v˜Š}Ü×$Ñ$ Q¨Ó,‘Ø�3‘˜3’Ü×$Ñ$ Q¨Ó,‘ä"Ð#FÈÈ3ÉÑ#OÓPÐPàˆyÜ Ð!EÈÈ#ÉÑ!NÓOÐOàŸ™›‰JˆS�#Ø�$�3�˜!˜C !™G c¨A¡gÐ.Ñ.°°3°4°Ñ8ˆAØ—%‘%“'˜A‘+ˆCà ”#�a“&Š=Ø �L‰L˜ŒOØ à €LóO ðN €Lr$cóš—|€,dj|j|«}|dddk(r|dddz}tj|«|s||Žyy)aœPerform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an argument tuple for it (to embody the "external action" being performed), and an optional message to print. Nz{}{!r}éþÿÿÿz,)rÚ))ÚformatÚ__name__rÚinfo)ÚfuncÚargsÚmsgÚverboseÚdry_runs r"Úexecuter­AsT€ð €{Ø�o‰o˜dŸm™m¨TÓ2ˆØ ˆrˆsˆ8�tÒ Ø�a˜�)˜c‘/ˆCä‡H�HˆS„MÙ Ù ˆdŠ ð r$cój—|j«}|dvry|dvrytdj|««‚)zôConvert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values are 'n', 'no', 'f', 'false', 'off', and '0'. Raises ValueError if 'val' is anything else. )ÚyÚyesÚtÚtrueÚonÚ1r)rJÚnoÚfÚfalseÚoffÚ0rzinvalid truth value {!r})rrOr¥)Úvals r"Ú strtoboolr»Ts>€ð �)‰)‹+€CØ Ð2Ñ2ØØ Ð5Ñ 5ØäÐ3×:Ñ:¸3Ó?Ó@Ð@r$có^—tjr td«‚|€|dk(}|�s1 ddlm}|d«\} } tjd| «|s“| �tj| d«} n t| d«} | 5| jd «| jd jtt|««d z«| jd |›d |›d|›d|›d|›d� «ddd«tj g} | j#t%j&««| j)| «t+| |¬«t-tj.| fd| z|¬«yddlm}|D�]}|dddk7rŒ |dk\r+|dk(rdn|}t4j6j9||¬«}nt4j6j9|«}|}|r0|dt;|«|k7rt=d|›d|›�«‚|t;|«d}|r tj>j||«}tj>jA|«}|sŒÔ|s tC||«r&tjd||«|rŒü||||«�ŒtjDd||«�Œ!y#t $rddlm} d| d«} } Y�ŒfwxYw#1swY�ŒÉxYw)a~Byte-compile a collection of Python source files to .pyc files in a __pycache__ subdirectory. 'py_files' is a list of files to compile; any files that don't end in ".py" are silently skipped. 'optimize' must be one of the following: 0 - don't optimize 1 - normal optimization (like "python -O") 2 - extra optimization (like "python -OO") If 'force' is true, all files are recompiled regardless of timestamps. The source filename encoded in each bytecode file defaults to the filenames listed in 'py_files'; you can modify these with 'prefix' and 'basedir'. 'prefix' is a string that will be stripped off of each source filename, and 'base_dir' is a directory name that will be prepended (after 'prefix' is stripped). You can supply either or both (or neither) of 'prefix' and 'base_dir', as you wish. If 'dry_run' is true, doesn't actually do anything that would affect the filesystem. Byte-compilation is either done directly in this interpreter process with the standard py_compile module, or indirectly by writing a temporary script and executing it. Normally, you should let 'byte_compile()' figure out to use direct compilation or not (see the source for details). The 'direct' flag is used by the script generated in indirect mode; unless you know what you're doing, leave it set to None. zbyte-compiling is disabled.Nr)Úmkstempz.py)Úmktempz$writing byte-compilation script '%s'Úwz2from distutils.util import byte_compile files = [ z, z] z byte_compile(files, optimize=z, force=z, prefix=z , base_dir=z, verbose=z$, dry_run=0, direct=1) )r¬z removing %s)rŒéýÿÿÿr7)Ú optimizationzinvalid prefix: filename z doesn't start with zbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#rÚdont_write_bytecoderÚtempfiler½rfr¾rr§rÚfdopenÚopenÚwriterSÚmapÚreprÚ executableÚextendÚ subprocessÚ"_optim_args_from_interpreter_flagsr™rr­rPÚ py_compilerŒÚ importlibÚutilÚcache_from_sourcer˜rOrRÚbasenamerÚdebug)Úpy_filesÚoptimizeÚforcer‰Úbase_dirr«r¬Údirectr½Ú script_fdÚ script_namer¾ÚscriptÚcmdrŒÚfileÚoptÚcfileÚdfileÚ cfile_bases r"Ú byte_compilerádsh€ôP ×ÒÜ'Ð(EÓFÐFð€~Ø'¨1™}ˆò ð ;Ý (á'.¨u£~Ñ $ˆY˜ ô �‰Ð7¸ÔEÙØÐ$ÜŸ™ 9¨cÓ2‘ä˜k¨3Ó/�âØ— ‘ ðôð"— ‘ ˜UŸZ™Z¬¬D°(Ó(;Ó<¸uÑDÔEØ— ’ ò ¢ª²º'ð Cô÷'ô:�~‰~ÐˆØ � ‰ ”:×@Ñ@ÓBÔCØ � ‰ �;ÔÜ ˆc˜7Õ#Ü”— ‘ ˜K˜>¨=¸;Ñ+FÐPWÖXõ 'äˆDØ�B�Cˆy˜EÒ!ðð ˜1Š}Ø$¨šM‘b¨x�Ü!Ÿ™×8Ñ8¸ÈCÐ8ÓP‘ä!Ÿ™×8Ñ8¸Ó>�؈EÙØ˜ œ#˜f›+Ð&¨&Ò0Ý$â¡ð)óððœc &›k˜mÐ,�ÙÜŸ™Ÿ ™  X¨uÓ5�䟙×)Ñ)¨%Ó0ˆJÚÙœE $¨Ô.Ü—H‘HÐ6¸¸jÔIÚ"Ù  e¨UÖ3ä—I‘IÐEÀtÈZÖXñAøôkò ;Ý 'à'+©V°E«]˜ ‹Yð ;ú÷‘ús§JÁ7A$J"ÊJÊJÊ"J,cóJ—|jd«}d}|j|«S)zŒReturn a version of the string escaped for inclusion in an RFC-822 header, by ensuring there are 8 spaces space after each newline. Ú z )rGrS)ÚheaderÚlinesrNs r"Ú rfc822_escaperæûs%€ð �L‰L˜Ó €EØ €CØ �8‰8�E‹?Ðr$)zerror: )Nrr)rrNNrrN)+Ú__doc__Úimportlib.utilrÎrr�r�rËrrÚ functoolsÚerrorsrrÚ _modifiedrrÚ_logrr#rÚplatformr3r:r5r<rDr@rVr^Ú lru_cacherhryrtrŠr�r�r‘r’r¡r­r»rárær4r$r"Úrïsíðñó Û Û Û ÛÛ ÛÛçEÝÝÝò$ò: ð‡<�<�8ÒØÐØ/Ðòò òò@*ò  ò:Nð*€×ÑÓñ,óð,ò,4ò&ó(ð+/Ð.€ Ð.� ˜Zò2ò<óDò& Að$Ø Ø Ø Ø Ø Ø óTYónr$