
    ,hxu              
         d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl	m
Z
 ddlmZmZ ddlmZ ddlmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZ ddlmZmZmZmZ ddlm Z! dZ"ddddddZ#dddddddddddde#dddddddddddddZ$e"rd d d!d"d#de$d$<   d d d%d&d#de$d'<   e$jK                  e!jL                         dZ'd( Z(d) Z)d* Z*d+ Z+d, Z,d- Z-d. Z.d/ Z/d0 Z0 G d1 d2e      Z1y)3zFdistutils.command.install

Implements the Distutils 'install' command.    )annotationsN)log)	USER_BASE	USER_SITE)ClassVar   )Command)DEBUG)DistutilsOptionErrorDistutilsPlatformError)
write_file)get_config_vars)change_rootconvert_pathget_platform
subst_vars   )_framework_compatTz{base}/Lib/site-packagesz{base}/Include/{dist_name}z{base}/Scriptsz{base})purelibplatlibheadersscriptsdatazA{base}/lib/{implementation_lower}{py_version_short}/site-packageszN{platbase}/{platlibdir}/{implementation_lower}{py_version_short}/site-packageszM{base}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z
{base}/binz!{base}/lib/{implementation_lower}z*{base}/{platlibdir}/{implementation_lower}z1{base}/include/{implementation_lower}/{dist_name}z{base}/site-packagesz{base}/include/{dist_name})posix_prefix
posix_homentpypypypy_ntz
{usersite}zF{userbase}/{implementation}{py_version_nodot_plat}/Include/{dist_name}z:{userbase}/{implementation}{py_version_nodot_plat}/Scriptsz
{userbase}nt_userzQ{userbase}/include/{implementation_lower}{py_version_short}{abiflags}/{dist_name}z{userbase}/bin
posix_userc            	         t        j                  t              5  t        j                         D  ci c]  } | t        j
                  | d       c} cd d d        S c c} w # 1 sw Y   y xY w)NF)expand)
contextlibsuppressAttributeError	sysconfigget_scheme_names	get_paths)schemes    g/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/setuptools/_distutils/command/install.py_load_sysconfig_schemesr+   c   sb    			^	, 
 $446
 I''u==

 


 
s   A!AA!A!!A*c            	         t               xs i } t        t        j                  t        |             D ci c]-  }|i t        j                  |i       | j                  |i       / c}S c c}w )z=
    Extend default schemes with schemes from sysconfig.
    )r+   set	itertoolschainINSTALL_SCHEMESget)sysconfig_schemesr)   s     r*   _load_schemesr3   k   s{    
 017R )///;LMN
 	 	 
!!&"-
##FB/
 	
  s   2A)c                 &    t        t        d      ryy)Npypy_version_infoPyPyPython)hasattrsys     r*   _get_implementationr<   {   s    s'(r;   c                    t        |t        t        |                  }t        |       j	                  t        | t        |                   y N)_inject_headers_load_scheme_resolve_schemevarsupdate_remove_set_scheme_attrs)obnamer)   s      r*   _select_schemerH      s4    T<0E#FGFHOOKM&$9:;r;   c                p    |j                         D ci c]  \  }}t        | |      || c}}S c c}}w )z1
    Include only attrs that are None in ob.
    )itemsgetattr)rF   attrskeyvalues       r*   rD   rD      s2     */S:3'"c:J:RCJSSSs   22c                    | j                  d      \  }}}	 t        j                  |      }|S # t        $ r t	        j
                  |       }Y |S w xY w)N_)	partitionr&   get_preferred_scheme	Exceptionfwr)   )rG   os_nameseprM   resolveds        r*   rA   rA      sV    s+GS##11#6 O  #99T?O#s   . AAc                    t               |    S r>   )r3   )rG   s    r*   r@   r@      s    ?4  r;   c                F    t        |       }|j                  d|d          |S )z
    Given a scheme name and the resolved scheme,
    if the scheme does not include headers, resolve
    the fallback scheme for the name and use headers
    from it. pypa/distutils#88
    r   )r@   
setdefault)rG   r)   fallbacks      r*   r?   r?      s(     D!H
i)!45Mr;   c                B    t         D ci c]  }d| | |    c}S c c}w )z<Resolve install directories by applying the install schemes.install_)SCHEME_KEYS)r)   rM   s     r*   rE   rE      s&    5@AchsefSk)AAAs   c                  N   e Zd ZU dZg dZg dZded<   er)ej                  ddde	 d	f       ej                  d       d
diZ
ded<   d)dZd)dZd)dZd)dZd)dZd)dZd Zd)dZd)dZd)dZd)dZd)dZd)dZd Zd Zd Zd Zd Zd  Zd! Zd" Zd#efd$efd%efd&efd'd( fgZ y)*installz'install everything from build directory))zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)zinstall-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)zinstall-data=Nz%installation directory for data files)compileczcompile .py to .pyc [default])
no-compileNzdon't compile .py files)z	optimize=Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])forcefz1force installation (overwrite any existing files))
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed files)ra   re   rg   zClassVar[list[str]]boolean_optionsuserNzinstall in user site-package ''rc   ra   zClassVar[dict[str, str]]negative_optc                r   d| _         d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _	        d| _
        d| _        d| _        t        | _        t        | _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        d| _        y)zInitializes options.NFT)prefixexec_prefixhomeri   install_baseinstall_platbaserootinstall_purelibinstall_platlibinstall_headersinstall_libinstall_scriptsinstall_datar   install_userbaser   install_usersitera   optimize
extra_pathinstall_path_filere   
skip_buildwarn_dir
build_base	build_librecordselfs    r*   initialize_optionszinstall.initialize_options   s     #''+ $		
 ! $ $	  $##'+#  ) ) !% 
  r;   c                	   | j                   s| j                  s| j                  r#| j                  s| j                  rt        d      | j                  r#| j                   s| j                  rt        d      | j                  rG| j                   s0| j                  s$| j                  s| j                  s| j                  rt        d      t        j                  dk7  r$| j                  r| j                  d       d| _        | j                  d       t        j                  dk(  r| j                          n| j                          | j                  d       t        j                  j                         d	   }t!        d
d      \  }}	 t        j"                  }| j&                  j)                         | j&                  j+                         | j&                  j-                         |t        j.                  j0                   dt        j.                  j2                   t        j.                  j0                   t        j.                  j2                   |||||t5        t        dd      t7               j9                         t7               d}t;        t5        t        dd      j=                  dd            }t>        r| j@                  |d<   | jB                  |d<   tE        jF                  |tI        j                          |tK        jL                               | _'        | jQ                          | j                  d       | j                  |d<   | j                  |d<   tR        r,d	dl*m*} tW        d        |t;        | jN                               | jY                          | j                  d       | j                  r| j[                          | j\                  =| j&                  j_                         r| j`                  | _.        n| jb                  | _.        | je                  dddddddd       | jg                          | j\                  | _4        t        jj                  jm                  | j\                  | jn                        | _.        | jp                  | js                  d dddddd       | j                  d!       | ju                  d"d#d$       y# t$        $ r d}Y >w xY w)%zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)baseposixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()r   rm   rn    .
platlibdirlib)	dist_namedist_versiondist_fullname
py_versionpy_version_shortpy_version_nodot
sys_prefixrm   sys_exec_prefixrn   abiflagsr   implementation_lowerimplementationwinver)py_version_nodot_platuserbaseusersitezpost-expand_basedirs()baseplatbase)pprintzconfig vars:zpost-expand_dirs()r   r   r   r   r   libbasezafter prepending rootbuild)r   r   )r   r   );rm   rn   ro   rp   rq   r   ri   osrG   warn	dump_dirsfinalize_unixfinalize_otherr9   versionsplitr   r   r%   distributionget_nameget_versionget_fullnameversion_infomajorminorrK   r<   lowerdictreplaceHAS_USER_SITEry   rz   collectionsChainMapr&   rT   rB   config_varsexpand_basedirsr
   r   printexpand_dirscreate_home_pathrv   has_ext_modulesrt   rs   convert_pathshandle_extra_pathinstall_libbasepathjoin
extra_dirsrr   change_rootsset_undefined_options)r   r   rm   rn   r   
local_varscompat_varsr   s           r*   finalize_optionszinstall.finalize_optionsD  s     KK4++tyy!6!6&i  99$++)9)9&K  99KKyy  $$&:  77g		GH#'  	2377g !56 [[&&(+
 /- H	||H
 **335 --99;!..;;=$#&#3#3#9#9":!C<L<L<R<R;S T#&#3#3#9#9":3;K;K;Q;Q:R S *& !#|U;$7$9$?$?$A13

$ ")#x"<"D"DS""M

 %)%:%:Jz"%)%:%:Jz"&//%%'GGI	
 	/0 "..
6!%!6!6
:%.!4(()* 	+, 99!!# #  002#'#7#7 #'#7#7  			
  	 #//77<<(8(8$//J 99 5)Y	69 	./ 	""13M	
Q  	H	s   S SSc                t   t         syddlm} t        j                  |dz          | j
                  D ]  }|d   }|d   dk(  r|dd }|| j                  v r.| j                  |   }|j                  |      }t        | |       }n|j                  |      }t        | |      }t        j                  d||        y)	zDumps the list of user options.Nr   )longopt_xlate:r   =z  %s: %s)	r
   fancy_getoptr   r   debuguser_optionsrk   	translaterK   )r   msgr   optopt_namevals         r*   r   zinstall.dump_dirs  s    0		#)$$ 	1C1vH|s"#Ab>4,,,,,X6#--m<!$11#--m<dH-IIj(C0	1r;   c                   | j                   | j                  l| j                  du xr | j                  du xr | j                  du xs. | j
                  du xs | j                  du xs | j                  du }|rt        d      y| j                  rA| j                  t        d      | j                  x| _         | _        | j                  d       y| j                  *| j                  x| _         | _        | j                  d       y| j                  | j                  t        d      t!        t"        dd      }t$        j&                  j)                  t*        j                        |z   | _        t$        j&                  j)                  t*        j                        |z   | _        n| j                  | j                  | _        | j                  | _         | j                  | _        | j                  d	       y)
z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete$User base directory is not specifiedr    r   z*must not supply exec-prefix without prefix_prefix_additionr   r   )rp   rq   rv   rs   rt   ru   rw   rx   r   ri   ry   r   select_schemero   rm   rn   rK   r&   r   r   normpathr9   )r   incomplete_schemer   s      r*   r   zinstall.finalize_unix  s   (D,A,A,M $$, 5,,45,,4-
 ''4/- ''4/- $$,  !*8  99$$,,-STT8<8M8MMD 5|,YY"8<		AD 5|,{{"##/.D 
 $+96H"#M  gg..szz:=MM#%77#3#3COO#DGW#W  ##+'+{{D$ $D$($4$4D!~.r;   c                l   | j                   rR| j                  t        d      | j                  x| _        | _        | j                  t        j                  dz          y| j                  *| j                  x| _        | _        | j                  d       y| j                  2t        j                  j                  t        j                        | _	        | j                  x| _        | _        	 | j                  t        j                         y# t        $ r t        dt        j                   d      w xY w)z)Finalizes options for non-posix platformsNr   _userr   z&I don't know how to install stuff on 'rj   )ri   ry   r   rp   rq   r   r   rG   ro   rm   r   r   r9   KeyErrorr   s    r*   r   zinstall.finalize_other@  s    99$$,,-STT8<8M8MMD 5rww01YY"8<		AD 5|,{{" gg..szz:8<CD 5""277+ ,<RWWIQG s   ,D 'D3c                    t        | |       y r>   )rH   )r   rG   s     r*   r   zinstall.select_schemeV  s    tT"r;   c                    |D ]e  }t        | |      }|t        j                  dv rt        j                  j	                  |      }t        || j                        }t        | ||       g y )N)r   r   )rK   r   rG   r   
expanduserr   r   setattr)r   rL   attrr   s       r*   _expand_attrszinstall._expand_attrsY  s`     	)D$%C77o-'',,S1C d&6&67dC(	)r;   c                *    | j                  g d       y)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.)rp   rq   rr   Nr   r   s    r*   r   zinstall.expand_basedirsb  s     	GHr;   c                *    | j                  g d       y)z+Calls `os.path.expanduser` on install dirs.)rs   rt   rv   ru   rw   rx   Nr   r   s    r*   r   zinstall.expand_dirsg  s     
 	r;   c                \    |D ]'  }d|z   }t        | |t        t        | |                   ) y)z!Call `convert_path` over `names`.r]   N)r   r   rK   r   namesrG   r   s       r*   r   zinstall.convert_pathsr  s5     	CD$DD$WT4-@ AB	Cr;   c                   | j                   | j                  j                   | _         | j                   t        j                  d       t	        | j                   t
              r | j                   j                  d      | _         t        | j                         dk(  r| j                   d   x}}n3t        | j                         dk(  r| j                   \  }}nt        d      t        |      }nd}d}|| _
        || _        y)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.,r   r   r   zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr   )r|   r   r   warning
isinstancestrr   lenr   r   	path_filer   )r   r   r   s      r*   r   zinstall.handle_extra_pathx  s    ??""//::DO??&KK. $//3/"&//"7"7"<4??#q()-);;	JT__%*(,%	:*B  &j1JIJ #$r;   c                r    |D ]2  }d|z   }t        | |t        | j                  t        | |                   4 y)z:Change the install directories pointed by name using root.r]   N)r   r   rr   rK   r   s       r*   r   zinstall.change_roots  s;     	MD$DD$DIIwtT7J KL	Mr;   c                x   | j                   syt        t        j                  j	                  d            }| j
                  j                         D ]h  }t        |      j                  |      st        j                  j                  |      r>| j                  d| d       t        j                  |d       j y)zCreate directories under ~.N~zos.makedirs('z	', 0o700)i  )ri   r   r   r   r   r   valuesr   
startswithisdirdebug_printmakedirs)r   ro   r   s      r*   r   zinstall.create_home_path  s    yyBGG..s34$$++- 	)D4y##D)"''--2E  =i!@AD%(	)r;   c                F   | j                   sZ| j                  d       | j                  j                  d      j                  }| j
                  r|t               k7  rt        d      | j                         D ]  }| j                  |        | j                  r| j                          | j                  r| j                         }| j                  r9t        | j                        }t        t        |            D ]  }||   |d ||<    | j!                  t"        | j                  |fd| j                   d       t%        t&        j(                  j*                  t,        j(                        }t%        t&        j(                  j.                  |      }t&        j(                  j/                  t&        j(                  j+                  | j0                              }| j
                  r?| j                  r| j2                  s&||vr!t5        j6                  d| j0                         yyyy)zRuns the command.r   z"Can't install when cross-compilingNz$writing list of installed files to 'rj   zmodules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r~   run_commandr   get_command_obj	plat_namer   r   r   get_sub_commandsr   create_path_filer   get_outputsrr   r   rangeexecuter   mapr   r   r   r9   normcaserv   r}   r   r   )r   
build_platcmd_nameoutputsroot_lencountersys_pathrv   s           r*   runzinstall.run  s    W%**::7CMMJ }}|~!=,-QRR --/ 	'HX&	' >>!!# ;;&&(Gyytyy>$S\2 CG'.w'7	'BGG$CLLg&6t{{m1E rww''2rww''2gg&&rww'7'78H8H'IJMM^^(>(>8+IIE    , )? r;   c                   t         j                  j                  | j                  | j                  dz         }| j
                  r(| j                  t        || j                  gfd|        y| j                  d| d       y)zCreates the .pth file.pthz	creating zpath file 'z' not createdN)
r   r   r   r   r   r}   r   r   r   r   )r   filenames     r*   r   zinstall.create_path_file  sk    77<< 4 4dnnv6MN!!LLX'89Yxj;Q IIH:];<r;   c                h   g }| j                         D ]>  }| j                  |      }|j                         D ]  }||vs|j                  |        @ | j                  rR| j
                  rF|j                  t        j                  j                  | j                  | j                  dz                |S )z.Assembles the outputs of all the sub-commands.r	  )
r   get_finalized_commandr   appendr   r}   r   r   r   r   )r   r  r  cmdr
  s        r*   r   zinstall.get_outputs  s    --/ 	-H,,X6C  OO- -7*NN8,-		- >>d44NN277<<(<(<dnnv>UVWr;   c                    g }| j                         D ]2  }| j                  |      }|j                  |j                                4 |S )z*Returns the inputs of all the sub-commands)r   r  extend
get_inputs)r   inputsr  r  s       r*   r  zinstall.get_inputs  sK     --/ 	,H,,X6CMM#..*+	, r;   c                n    | j                   j                         xs | j                   j                         S )zSReturns true if the current distribution has any Python
        modules to install.)r   has_pure_modulesr   r   s    r*   has_libzinstall.has_lib  s/     ..0WD4E4E4U4U4W	
r;   c                6    | j                   j                         S )zLReturns true if the current distribution has any headers to
        install.)r   has_headersr   s    r*   r  zinstall.has_headers         ,,..r;   c                6    | j                   j                         S )zMReturns true if the current distribution has any scripts to.
        install.)r   has_scriptsr   s    r*   r  zinstall.has_scripts  r  r;   c                6    | j                   j                         S )zJReturns true if the current distribution has any data to.
        install.)r   has_data_filesr   s    r*   has_datazinstall.has_data  s       //11r;   rv   ru   rw   rx   install_egg_infoc                     y)NTr:   r   s    r*   <lambda>zinstall.<lambda>$  s    r;   )returnNone)!__name__
__module____qualname__descriptionr   rh   __annotations__r   r  r   rk   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r   r   r  r  r  r  r  sub_commandsr:   r;   r*   r`   r`      s
   ;K8Lt ,NO(M,YKq9
 	
 	v&.:I-FL*FEZr
n1(//b,#)I
	C!%FM)0d= 
/
/
2 
 	K(	K(	"	./Lr;   r`   )2__doc__
__future__r   r   r#   r.   r   r9   r&   distutils._logr   siter   r   typingr   corer	   r   r
   errorsr   r   	file_utilr   r   utilr   r   r   r   r   r   rT   r   WINDOWS_SCHEMEr0   rC   schemesr^   r+   r3   r<   rH   rD   rA   r@   r?   rE   r`   r:   r;   r*   <module>r4     sa  / #    	 
   %    A " ' F F % *)+ W+3 7?F ))/ *)/#3 F O"OI  3#%OL!   rzz " C
 <
T!B
w	g w	r;   