+
    SBi+                    b   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
Ht ^ RIHtHt ^RIHtHt ]'       d   ^ RIHt ^RIHt ^ RIHt ^ R	IHt  ! R
 R]RR7      t ! R R]4      t ! R R]4      t ! R R4      t ! R R]4      t ! R R]4      t R t!R t"R t#R t$R t%R# )    )annotationsN)Iterable)TYPE_CHECKING	TypedDict)metadata	resources)Self)SetuptoolsWarning)first_line_re)get_platformc                  ,    ] tR t^t$ R]R&   R]R&   RtR# )
_SplitArgsboolcommentsposix N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r       8/usr/lib/python3.14/site-packages/setuptools/_scripts.pyr   r      s    NKr   r   F)totalc                      ] tR t^t$ Rt. tR]R&   ]! 4       t]	R 4       t
]	R 4       t]	R R l4       t]	R 4       t]	R	 R
 l4       tR R lt]R 4       tR t]R 4       t]R 4       tRtR# )CommandSpecza
A command spec for a #! header, specified as a list of arguments akin to
those passed to Popen.
z	list[str]optionsc                    V # )zF
Choose the best CommandSpec class based on environmental conditions.
r   clss   &r   bestCommandSpec.best'   s	    
 
r   c                	    \         P                  P                  \        P                  4      p\         P
                  P                  R V4      # )__PYVENV_LAUNCHER__)ospathnormpathsys
executableenvironget)r!   _defaults   & r   _sys_executableCommandSpec._sys_executable.   s0    77##CNN3zz~~3X>>r   c                    V ^8  d   QhRRRR/# )   paramz!Self | str | Iterable[str] | Nonereturnr	   r   )formats   "r   __annotate__CommandSpec.__annotate__4   s     K K@ KT Kr   c                   \        W4      '       d   V# \        V\        4      '       d   V P                  V4      # \        V\        4      '       d	   V ! V4      # Vf   V P	                  4       # \        R\        V4       24      h)zO
Construct a CommandSpec from a parameter to build_scripts, which may
be None.
z!Argument has an unsupported type )
isinstancestrfrom_stringr   from_environment	TypeErrortype)r!   r2   s   &&r   
from_paramCommandSpec.from_param3   sr     e!!LeS!!??5))eX&&u:=''));DK=IJJr   c                	0    V ! V P                  4       .4      # N)r.   r    s   &r   r;   CommandSpec.from_environmentC   s    C'')*++r   c                    V ^8  d   QhRRRR/# )r1   stringr9   r3   r	   r   )r4   s   "r   r5   r6   H   s        r   c                T    \         P                  ! V3/ V P                  B pV ! V4      # )ze
Construct a command spec from a simple string representing a command
line parseable by shlex.split.
)shlexsplit
split_args)r!   rD   itemss   && r   r:   CommandSpec.from_stringG   s%     F5cnn55zr   c                   V ^8  d   QhRR/# )r1   script_textr9   r   )r4   s   "r   r5   r6   P   s     & &3 &r   c                	    \         P                  ! V P                  V4      4      V n        \        P
                  ! V 4      p\        V4      '       g   R .V P                  R&   R# R# )z-x:Nr   NN)rF   rG   _extract_optionsr   
subprocesslist2cmdlineisascii)selfrL   cmdlines   && r   install_optionsCommandSpec.install_optionsP   sM    {{4#8#8#EF))$/w $vDLL  r   c                    V R,           P                  4       ^ ,          p\        4       P                  V4      pV'       d   VP                  ^4      ;'       g    RMRpVP	                  4       # )z8
Extract any options from the first line of the script.

 )
splitlines_first_line_rematchgroupstrip)orig_scriptfirstr[   r   s   &   r   rN   CommandSpec._extract_optionsV   sU    
 t#//1!4 &&u-*/%++a.&&BR}}r   c                	X    V P                  V \        V P                  4      ,           4      # rA   )_renderlistr   )rR   s   &r   	as_headerCommandSpec.as_header`   s    ||D4#5566r   c                	    R pV F:  pV P                  V4      '       g   K  V P                  V4      '       g   K5  V ^R u # 	  V # )z"')
startswithendswith)item_QUOTESqs   &  r   _strip_quotesCommandSpec._strip_quotesc   sA    Aq!!dmmA&6&6Abz!  r   c                	\    \         P                  ! R  V  4       4      pRV,           R,           # )c              3  h   "   T F(  p\         P                  VP                  4       4      x  K*  	  R # 5irA   )r   rm   r]   ).0rj   s   & r   	<genexpr>&CommandSpec._render.<locals>.<genexpr>m   s'      *
@EK%%djjl33s   02z#!rW   )rO   rP   )rI   rS   s   & r   rb   CommandSpec._renderk   s0    )) *
@E*
 
 g~$$r   )r   N)r   r   r   r   __doc__r   r   r   rH   classmethodr"   r.   r>   r;   r:   rT   staticmethodrN   rd   rm   rb   r   r   r   r   r   r      s    
 GYJ  ? ? K K , ,  &  7   % %r   r   c                  (    ] tR t^st]! RR7      tRtR# )WindowsCommandSpecF)r   r   N)r   r   r   r   r   rH   r   r   r   r   ry   ry   s   s    %(Jr   ry   c                      ] tR t^wtRt]P                  ! R4      P                  4       t]	t
]RR l4       t]R 4       t]R 4       t]R 4       t]RR R	 ll4       tR
tR# )ScriptWriterzT
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)())
        Nc              #  D  "   \        VR4      '       g@   \        P                  ! R4       \        P                  P                  VP                  4      pVf   V P                  4       pVP                   RVP                   2pR F  pV R2pVP                  P                  VR7       Fk  pVP                  pV P                  VP                  4       V P                  \        4       ,          pV P                  WFP                  W(4      p	T	 Rj  xL
  Km  	  K  	  R#  L5i)zi
Yield write_script() argument tuples for a distribution's
console_scripts and gui_scripts entry points.
entry_pointsz%Unsupported distribution encountered.Nz==_scripts)r\   consolegui)hasattrr
   emitr   Distributionategg_info
get_headernameversionr}   select_ensure_safe_nametemplatelocals_get_script_args)
r!   distheaderspectype_r\   epr   rL   argss
   &&&       r   get_argsScriptWriter.get_args   s      t^,,""#JK((++DMM:D>^^%F))Bt||n-%EgX&E''..U.;ww%%bgg.!llVX5++E77FP < &  s   DD DD c                Z    \         P                  ! RV 4      pV'       d   \        R4      hR# )z/
Prevent paths in *_scripts entry point names.
z[\\/]z+Path separators not allowed in script namesN)research
ValueError)r   has_path_seps   & r   r   ScriptWriter._ensure_safe_name   s(    
 yy40JKK r   c                    \         P                  R8X  g+   \        P                  R8X  d*   \        P                  R8X  d   \
        P                  4       # V # )z4
Select the best ScriptWriter for this environment.
win32javant)r)   platformr&   r   _nameWindowsScriptWriterr"   r    s   &r   r"   ScriptWriter.best   s:    
 <<7"rww&'8RXX=M&++--Jr   c              #  	&   "   W#V,           3x  R # 5irA   r   )r!   r   r   r   rL   s   &&&&&r   r   ScriptWriter._get_script_args   s      k)**s   c               $    V ^8  d   QhRRRRRR/# )r1   rL   r9   r*   z(str | CommandSpec | Iterable[str] | Noner3   r   )r4   s   "r   r5   ScriptWriter.__annotate__   s(       = 
	r   c                    V P                   P                  4       P                  V4      pVP                  V4       VP	                  4       # )z;Create a #! line, getting options (if any) from script_text)command_spec_classr"   r>   rT   rd   )r!   rL   r*   cmds   &&& r   r   ScriptWriter.get_header   s=     $$))+66zBK(}}r   r   rA   )rX   N)r   r   r   r   ru   textwrapdedentlstripr   r   r   rv   r   rw   r   r"   r   r   r   r   r   r   r{   r{   w   s    
 !	#F fhG J %   0 L L   + +  r   r{   c                  Z    ] tR t^t]t]R 4       t]R 4       t]R 4       t	]
R 4       tRtR# )r   c                t    \        \        V R7      p\        P                  P	                  RR4      pW,          # )z3
Select the best ScriptWriter suitable for Windows
)r*   naturalSETUPTOOLS_LAUNCHERr*   )dictWindowsExecutableLauncherWriterr&   r+   r,   )r!   writer_lookuplaunchers   &  r   r"   WindowsScriptWriter.best   s4    
 6

 ::>>"7F&&r   c              #    "   \        RRR7      V,          pV\        P                  R,          P                  4       P	                  R4      9  d1   RP
                  ! R	/ \        4       B p\        P                  ! V4       . R
OpVP                  V4       V P                  W4      pV Uu. uF  qV,           NK  	  p	pW%,           W4,           RV	3x  R# u upi 5i)z For Windows, add a .py extension.pya.pywr   PATHEXT;zK{ext} not listed in PATHEXT; scripts will not be recognized as executables.tNr   )r   .py
-script.py.pyc.pyor   .exe)r   r&   r+   lowerrG   r4   r   r
   r   remove_adjust_header)
r!   r   r   r   rL   extmsgoldxblockerss
   &&&&&     r   r   $WindowsScriptWriter._get_script_args   s      6v.u5bjj+11399#>>-f ! x!C ""3'K

3##E2&)*c1HHc*j&.X== +s   B(C*C;Cc                    RpRpVR8X  d   YCrC\         P                  ! \         P                  ! V4      \         P                  4      pVP	                  W$R7      pV P                  V4      '       d   V# T# )zn
Make sure 'pythonw' is used for gui and 'python' is used for
console (regardless of what sys.executable is).
zpythonw.exez
python.exer   )rD   repl)r   compileescape
IGNORECASEsub_use_header)r!   r   orig_headerpatternr   
pattern_ob
new_headers   &&&    r   r   "WindowsScriptWriter._adjust_header  s`      E> TZZ		' 2BMMB
^^;^B
 __Z88zIkIr   c                    V ^R P                  R4      p\        P                  R8g  ;'       g    \        P                  ! V4      # )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   rg   )r]   r)   r   shutilwhich)r   clean_headers   & r   r   WindowsScriptWriter._use_header  s;     "!B'--c2||w&DD&,,|*DDr   r   N)r   r   r   r   ry   r   rv   r"   r   r   rw   r   r   r   r   r   r   r      sZ    +
' 
' > > J J 	E 	Er   r   c                  &    ] tR tRt]R 4       tRtR# )r   i  c              #  B  "   VR8X  d	   RpRpR.pMRpRp. ROpV P                  W4      pV U	u. uF  qV	,           NK  	  p
p	W&,           W,           RV
3x  VR,           \        V4      R3x  \        4       '       g   VR	,           pV\        V4      R3x  R
# R
# u up	i 5i)z7
For Windows, add a .py extension and an .exe launcher
r   z-script.pywr   clir   r   r   bz.exe.manifestN)r   r   r   )r   get_win_launcheris_64bitload_launcher_manifest)r!   r   r   r   rL   launcher_typer   r   hdrr   r   m_names   &&&&&       r   r   0WindowsExecutableLauncherWriter._get_script_args  s     
 E>!MC(C!MC)C  /&)*c1HHc*z3,c8<<6M]+
 	

 zz O+F1$7==  +s   -BB ABr   N)r   r   r   r   rv   r   r   r   r   r   r   r     s    > >r   r   c                    V  R2p\        4       '       d6   \        4       R8X  d   VP                  RR4      pM%VP                  RR4      pMVP                  RR4      p\        P                  ! R4      P                  V4      P                  4       # )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.
r   z	win-arm64.z-arm64.z-64.z-32.
setuptools)r   r   replacer   filesjoinpath
read_bytes)r=   launcher_fns   & r   r   r   <  sy     F$-Kzz>[(%--c9=K%--c6:K!))#v6??<(11+>IIKKr   c                    \         P                  ! \        4      P                  R 4      pVP	                  RR7      \        4       ,          # )zlauncher manifest.xmlzutf-8)encoding)r   r   r   r   	read_textvars)r   ress   & r   r   r   O  s4    
//(
#
,
,-D
EC=='=*TV33r   c                     \        \        P                  \        4      '       d   \        # \        P
                  ! \        P                  P                  4       4      # )zS
Return a regular expression based on first_line_re suitable for matching
strings.
)r8   r   r   r9   r   r   decoder   r   r   rZ   rZ   T  s=    
 -''-- ::m++22455r   c                 4    \         P                  ! R 4      ^8H  # )P)structcalcsizer   r   r   r   r   `  s    ??31$$r   c                N     V P                  R 4       R#   \         d     R# i ; i)asciiFT)encodeUnicodeError)ss   &r   rQ   rQ   d  s,    	   s    $$)&
__future__r   r&   r   rF   r   r   rO   r)   r   collections.abcr   typingr   r   
_importlibr   r   typing_extensionsr	   warningsr
   distutils.command.build_scriptsr   distutils.utilr   r   rc   r   ry   r{   r   r   r   r   rZ   r   rQ   r   r   r   <module>r
     s    " 	 	     
  $ + +& ' 9 '% 
R%$ R%j) )g gT8E, 8Ev>&9 >@L&4
	6%r   