
    nj#:                    0   S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKrSSKrSSKrSSKJrJrJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJrJr  SSKJrJr  SSK J r   \(       a  SSK!J"r"J#r#  \"" S5      r$\RJ                  r%\RL                  r&\RN                  r'\RP                  r)\RT                  r+\RX                  r-\R\                  r/S S jr0\S!S j5       r1      S"S jr2\Rf                  S#S j5       r4S$S jr5S r6S%S&S jjr7\Rp                  " S\	Rr                   S35      r:\Rp                  " S5      r;\Rp                  " S5      r<S'S jr=  S(         S)S jjr>S*S jr?      S+               S,S jjr@S-S jrAS.S jrBg)/zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
    )annotationsN)CallableIterableMapping)TYPE_CHECKING)	pass_none   )log)newer)detectmacos)DistutilsByteCompileErrorDistutilsPlatformError)spawn)TypeVarTupleUnpack_Tsc                b    U R                  S5       Vs/ s H  n[        U5      PM     sn$ s  snf )zEConvert a dot-separated string into a list of numbers for comparisons.)splitint)sns     V/var/www/html/pdf-tiff/venv/lib/python3.13/site-packages/setuptools/_distutils/util.pysplit_versionr   .   s&    GGCL)LqCFL)))s   ,c                V    [         R                  " [        R                  " U 5      5      $ )a
  
Allow for pathlib.Path inputs, coax to a native path string.

If None is passed, will just pass it through as
Setuptools relies on this behavior.

>>> convert_path(None) is None
True

Removes empty paths.

>>> convert_path('foo/./bar').replace('\\', '/')
'foo/bar'
)osfspathpathlibPurePath)pathnames    r   convert_pathr"   3   s      99W%%h/00    c                "   [         R                  S:X  ao  [         R                  R                  U5      (       d  [         R                  R	                  X5      $ [         R                  R	                  U [        U5      SS 5      $ [         R                  S:X  a\  [         R                  R                  U5      u  p#US   [         R                  :X  a  USS n[         R                  R	                  X5      $ [        S[         R                   S35      e)zReturn '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.
posixr	   Nntr   znothing known about platform '')	r   namepathisabsjoinstr
splitdrivesepr   )new_rootr!   _driver)   s       r   change_rootr1   F   s     
ww'ww}}X&&77<<33 77<<#h-*;<<	D++H57bff8Dww||H++
 #A"''!!L
MMr#   c                 Z   [         R                  S:X  aQ  S[         R                  ;  a=   SSKn U R	                  [         R
                  " 5       5      S   [         R                  S'   S[         R                  ;  a  [        5       [         R                  S'   gg! [        [        4 a     NCf = f)a4  Ensure 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%   HOMEr   N   PLAT)	r   r(   environpwdgetpwuidgetuidImportErrorKeyErrorget_platform)r7   s    r   check_environr=   `   s     
ww'fBJJ6	!$biik!:1!=BJJv RZZ)^

6   X& 	 	s   <B B*)B*c                
   [        5         [        [        R                  5      nUR	                  S UR                  5        5       5         [        U 5      R                  U5      $ ! [         a  n[        SU 35      eSnAff = f)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'.
c              3  @   #    U  H  u  pU[        U5      4v   M     g 7fNr,   ).0r(   values      r   	<genexpr>subst_vars.<locals>.<genexpr>   s     K8J4U$8Js   zinvalid variable N)
r=   dictr   r6   updateitems_subst_compat
format_mapr;   
ValueError)r   
local_varslookupvars       r   
subst_varsrO   w   sp     O"**F
MMK
8H8H8JKK4Q**622 4,SE2334s   A% %
B/A==Bc                x    S n[         R                  " SX5      nX :w  a  SSKnUR                  S[        5        U$ )zV
Replace shell/Perl-style variable substitution with
format-style. For compatibility.
c                ,    SU R                  S5       S3$ )N{r	   })group)matchs    r   _subst_subst_compat.<locals>._subst   s    EKKN#2&&r#   z\$([a-zA-Z_][a-zA-Z_0-9]*)r   Nz-shell/Perl-style substitutions are deprecated)resubwarningswarnDeprecationWarning)r   rV   replrZ   s       r   rI   rI      s;    ' 66/;Dy;	
 Kr#   c                    U[        U 5      -   $ r@   rA   )excprefixs     r   grok_environment_errorra      s     CHr#   z[^\\\'\"z ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*"c                "   U R                  5       n / nSnU (       Gar  [        R                  X5      nUc   eUR                  5       nU[	        U 5      :X  a  UR                  U SU 5         U$ X   [        R                  ;   a)  UR                  U SU 5        XS R                  5       n SnOX   S:X  a  U SU XS-   S -   n US-   nOX   S:X  a  [        R                  X5      nO/X   S:X  a  [        R                  X5      nO[        SX    S35      eUc  [        S	X    S
35      eUR                  5       u  pTU SU XS-   US-
   -   XS -   n UR                  5       S-
  nU[	        U 5      :  a  UR                  U 5         U$ U (       a  GMr  U$ )a  Split 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.
r   N\r	   r'   "zthis can't happen (bad char 'z')zbad string (mismatched z	 quotes?)   )strip_wordchars_rerU   endlenappendstring
whitespacelstrip
_squote_re
_dquote_reRuntimeErrorrK   span)r   wordsposmrh   begs         r   split_quotedrv      s    	
	AE
C
'}}eeg#a&=LL4C!D LA 6V&&& LL4C!$ ACVt^ $3!!GI,&A'C v}$$Q,3$$Q,"%B16("#MNNy #:16()!LMMJS$3!!GcAg..48A%%'A+C#a&=LLOLQ !P Lr#   c                    Uc"  U R                    U< 3nUSS S:X  a  USS S-   n[        R                  " U5        U " U6   g)z
Perform some action that affects the outside world (e.g. by
writing to the filesystem). Was previously used to deal with
"dry run" operations, but now runs unconditionally.
Nz,)r   ))__name__r
   info)funcargsmsgverboses       r   executer      sJ     {x(rs8ta)c/CHHSM$Kr#   c                \    U R                  5       n U S;   a  gU S;   a  g[        SU < 35      e)zConvert 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1T)r   noffalseoff0Fzinvalid truth value )lowerrK   )vals    r   	strtoboolr      s:     ))+C
22	5	5/w788r#   c                f   [         R                  (       a  [        S5      eUc  US:H  nU(       Gd)  [        R                  " S5      u  px[
        R                  " SU5        [        R                  " USSS9n	U	   U	R                  S	5        U	R                  S
R                  [        [        U 5      5      S-   5        U	R                  SU< SU< SU< SU< SU< S35        SSS5        [         R                  /n
U
R                  [        R                   " 5       5        U
R#                  U5        [%        U
5        ['        [        R(                  U4SU 35        gSSKJn  U  GH9  nUSS S:w  a  M  US:  a(  US:X  a  SOUn[.        R0                  R3                  XS9nO[.        R0                  R3                  U5      nUnU(       a3  US[5        U5       U:w  a  [7        SU< SU< 35      eU[5        U5      S nU(       a  [        R8                  R                  XO5      n[        R8                  R;                  U5      nU(       d  M  U(       d  [=        X5      (       a$  [
        R                  " SUU5        U" XU5        GM!  [
        R>                  " SUU5        GM<     g! , (       d  f       GN= f)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.

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.
zbyte-compiling is disabled.Nr   z.pyz$writing byte-compilation script '%s'wzutf-8)encodingz2from distutils.util import byte_compile
files = [
z,
z]
z
byte_compile(files, optimize=z, force=z,
         prefix=z, base_dir=z,
         verbose=z,
         direct=True)
z	removing )compile )optimizationzinvalid prefix: filename z doesn't start with zbyte-compiling %s to %sz%skipping byte-compilation of %s to %s) sysdont_write_bytecoder   tempfilemkstempr
   r{   r   fdopenwriter+   maprepr
executableextend
subprocess"_optim_args_from_interpreter_flagsrj   r   r   remove
py_compiler   	importlibutilcache_from_sourceri   rK   r)   basenamer   debug)py_filesoptimizeforcer`   base_dirr   direct	script_fdscript_namescriptcmdr   fileoptcfiledfile
cfile_bases                    r   byte_compiler     sM   H '(EFF ~'1} #+#3#3E#: 7E9cG<LL" LLCh$785@ALL&\% ;
+h\ 2 ' 8 ~~

:@@BC

;c
		K>Y{m+DE 	'DBCyE! 
 1}$Mbx!888P!88>E#f+&&0$3D8;OPVzZ  c&km,X5))%0JvE$..HH6jID/IIEtZX= S Vs   8A)J!!
J0c                    SnU R                  SS9nU=(       a    US   R                  5       S   US   :g  nU(       a  UOSnUR                  U5      U-   $ )zReturn a version of the string escaped for inclusion in an
RFC-822 header, by ensuring there are 8 spaces space after each newline.
z        T)keependsr   r   )
splitlinesr+   )headerindentlinesends_in_newlinesuffixs        r   rfc822_escaper     s`     Ft,E Fb	 4 4 6q 9U2Y FO&VBF;;u&&r#   c                 @    [        [        R                  " S5      5      $ )zKReturn True if the Python interpreter is built with free threading support.Py_GIL_DISABLED)bool	sysconfigget_config_var r#   r   is_freethreadedr     s    	(():;<<r#   )r   r,   returnz	list[int])r!   str | os.PathLike[str]r   r,   )r/   r   r!   r   r   r,   )r   None)rL   zMapping[str, object]r   r,   )zerror: )r_   objectr`   r,   r   r,   )r   r,   r   z	list[str])NF)
r|   zCallable[[Unpack[_Ts]], object]r}   ztuple[Unpack[_Ts]]r~   r   r   r   r   r   )r   r,   r   r   )r   FNNTN)r   zIterable[str]r   r   r   r   r`   
str | Noner   r   r   r   r   zbool | Noner   r   )r   r,   r   r,   )r   r   )C__doc__
__future__r   	functoolsimportlib.utilr   r   r   rX   rk   r   r   r   r   collections.abcr   r   r   typingr   jaraco.functoolsr   _logr
   	_modifiedr   compilers.platformr   r   errorsr   r   r   typing_extensionsr   r   r   get_host_platformr<   is_mingwVERSION_VARMACOSX_VERSION_VAR
target_verget_macosx_target_ver_target_ver_from_syscfg!get_macosx_target_ver_from_syscfg_clear_cached_target_ver_clear_cached_macosx_verr   r"   r1   	lru_cacher=   rO   rI   ra   r   rl   rg   rn   ro   rv   r   r   r   r   r   r   r#   r   <module>r      s   #   	  	   
   7 7   &   - E 6
u
C ,, ""??&& (( $)$A$A ! 99 *
 1 1$N$N$N 	N4 , ,,4&( 

hv'8'8&9=>ZZ,-
ZZ,-
;B 	
)
 
 	
 
(9$ BYBYBY BY 	BY
 BY BY BY 
BYJ'=r#   