
    *,hq                     ^   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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 d dlmZmZmZ d d	lmZ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% d dl&m'Z'm(Z( d dl)m*Z* d dl+m,Z,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2m3Z3 d dl4m5Z5m6Z6m7Z7m8Z8m9Z9 d dl:m;Z; d dl<m=Z=m>Z> d dl?m@Z@mAZA  e3eB      ZC G d de      ZD	 	 	 	 	 d-deEdeeF   deeF   deEdeeF   d e
eF   fd!ZGdeeF   deEd eEfd"ZH	 	 	 	 d.d#eeE   d$eeF   d%eeF   d&eeF   d'eEd eEfd(ZId)eJd*eEd+eEd eFfd,ZKy)/    N)SUPPRESS_HELPValues)ListOptional)
print_json)
WheelCache)
cmdoptions)make_target_python)RequirementCommandwarn_if_run_as_rootwith_cleanup)ERRORSUCCESS)CommandErrorInstallationError)
get_scheme)get_environment)InstallationReport)get_build_tracker)ConflictDetailscheck_install_conflicts)install_given_reqs)InstallRequirementcheck_legacy_setup_py_options)WINDOWStest_writable_dir)	getLogger)check_externally_managed
ensure_dirget_pip_version(protect_pip_from_modification_on_windowswrite_output)TempDirectory)running_under_virtualenvvirtualenv_no_global)build should_build_for_install_commandc                       e Zd ZdZdZddZededee	   de
fd       Zd	e	d
ededdfdZdee   dee   fdZdede	ddfdZy)InstallCommandaI  
    Install packages from:

    - PyPI (and other indexes) using requirement specifiers.
    - VCS project urls.
    - Local project directories.
    - Local or remote source archives.

    pip also supports installing from "requirements files", which provide
    an easy way to specify a whole environment to be installed.
    a%  
      %prog [options] <requirement specifier> [package-index-options] ...
      %prog [options] -r <requirements file> [package-index-options] ...
      %prog [options] [-e] <vcs project url> ...
      %prog [options] [-e] <local project path> ...
      %prog [options] <archive url/path> ...returnNc                    | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  t        j
                                | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  ddddd       | j                   j                  ddd	d
d d       t        j                  | j                          | j                   j                  dddd       | j                   j                  dddt               | j                   j                  ddd
d d       | j                   j                  ddd
d d       | j                   j                  t        j                                | j                   j                  ddddd       | j                   j                  ddddd gd!"       | j                   j                  d#d$dd%       | j                   j                  d&d'd(dd)       | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  t        j                                | j                   j                  t        j                                 | j                   j                  t        j"                                | j                   j                  t        j$                                | j                   j                  d*dd+d,d-       | j                   j                  d.dd+d/0       | j                   j                  d1dd2d,d3       | j                   j                  d4dd5d,d6       | j                   j                  t        j&                                | j                   j                  t        j(                                | j                   j                  t        j*                                | j                   j                  t        j,                                | j                   j                  t        j.                                | j                   j                  t        j0                                t        j2                  t        j4                  | j6                        }| j6                  j9                  d7|       | j6                  j9                  d7| j                          | j                   j                  d8d9d:d d;       y )<Nz	--dry-run
store_truedry_runFzDon't actually install anything, just print what would be. Can be used in combination with --ignore-installed to 'resolve' the requirements.)actiondestdefaulthelpz-tz--target
target_dirdirzInstall packages into <dir>. By default this will not replace existing files/folders in <dir>. Use --upgrade to replace existing packages in <dir> with new versions.)r0   metavarr1   r2   z--useruse_user_sitezInstall to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation for site.USER_BASE for full details.))r0   r/   r2   z	--no-userstore_falsez--root	root_pathz=Install everything relative to this alternate root directory.z--prefixprefix_patha[  Installation prefix where lib, bin and other top-level folders are placed. Note that the resulting installation may contain scripts and other resources which reference the Python interpreter of pip, and not that of ``--prefix``. See also the ``--python`` option if the intention is to install packages into another (possibly pip-free) environment.z-Uz	--upgradeupgradezUpgrade all specified packages to the newest available version. The handling of dependencies depends on the upgrade-strategy used.z--upgrade-strategyupgrade_strategyzonly-if-neededeageraG  Determines how dependency upgrading should be handled [default: %default]. "eager" - dependencies are upgraded regardless of whether the currently installed version satisfies the requirements of the upgraded package(s). "only-if-needed" -  are upgraded only when they do not satisfy the requirements of the upgraded package(s).)r0   r1   choicesr2   z--force-reinstallforce_reinstallz;Reinstall all packages even if they are already up-to-date.z-Iz--ignore-installedignore_installedzIgnore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed with a different package manager!z	--compilecompileTz'Compile Python source files to bytecodez--no-compilez.Do not compile Python source files to bytecode)r/   r0   r2   z--no-warn-script-locationwarn_script_locationz0Do not warn when installing scripts outside PATHz--no-warn-conflictswarn_about_conflictsz%Do not warn about broken dependenciesr   z--reportjson_report_filefileaW  Generate a JSON file describing what pip did to install the provided requirements. Can be used in combination with --dry-run and --ignore-installed to 'resolve' the requirements. When - is used as file name it writes to stdout. When writing to stdout, please combine with the --quiet option to avoid mixing pip logging output with JSON output.)cmd_opts
add_optionr	   requirementsconstraintsno_depspreeditableadd_target_python_optionsr   srcignore_requires_pythonno_build_isolation
use_pep517no_use_pep517check_build_depsoverride_externally_managedconfig_settingsglobal_options	no_binaryonly_binaryprefer_binaryrequire_hashesprogress_barroot_user_actionmake_option_groupindex_groupparserinsert_option_group)self
index_optss     `/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/pip/_internal/commands/install.pyadd_optionszInstallCommand.add_optionsH   s     !8!8!:;  !7!7!9:  !3!3!56  !12  !4!4!67  1 	! 
	
 	  % 	! 	
 	,,T]];   % 	! 
	
 	    	 	! 	
 	  P 	! 	
 	   	! 	
  	  !12  ) 	! 
	
 	   #$%w/G 	! 	
  	  "N	 	! 	
 	   #4 	! 	
 	  !B!B!DE  !>!>!@A  !6!6!89  !9!9!;<  !<!<!>?  !G!G!IJ  !;!;!=>  !:!:!<=  : 	! 	
 	   A	 	! 	
 	  ' 'C 	! 	
 	  ! '8 	! 	
 	  !5!5!78  !7!7!9:  !9!9!;<  !:!:!<=  !8!8!:;  !<!<!>?11""KK


 	'':6''4==9  #G 	! 	
    optionsargsc                    |j                   r|j                  t        d      |j                  xr |j                   xr. |j
                  d u xr |j                  d u xr |j                  d u }|r|j                  s
t                d}|j                  r|j                  }t        j                  |d       t        j                  dt                      t!        |j                   |j                  |j                  |j
                  |j"                        |_         d }d }|j                  rd|_        t&        j(                  j+                  |j                        |_        t&        j(                  j-                  |j                        r4t&        j(                  j/                  |j                        st        d      t1        d	      }|j(                  }| j3                  |       |j4                  xs g }| j7                  |      }t9        |      }	| j;                  |||	|j<                  
      }
| j3                  t?                     }t1        |j@                   dd      }	 | jC                  |||
|      }tE        ||       tG        |jH                        }|D ]	  }d|_%         | jM                  |||||
|j                   | jN                        }| jQ                  ||
|||j                   |j$                  |j<                  |jR                  ||jT                  
      }| jW                  |
       |jY                  ||j                         }|j                  rt[        |j\                        }|j                  dk(  rt_        |ja                                nHtc        |j                  dd      5 }te        jf                  |ja                         |dd       d d d        |j                  rV|ji                          tk        d |j\                  D              }|r"tm        ddjo                  d |D                     tp        S 	 |js                  d      }|jt                  d u }ty        |       |jz                  j}                         D cg c]  }t        |      r| }}t        ||dg |      \  }}|r0t        dj                  d jo                  d! |D                          |j                  |      }d }|j                   xr |j                  }|r| j                  |      }|j                  }|j                  s|j                  rd}t        |||j
                  ||j                  ||j                   |j                  "      } t        |j                   ||j
                  |j                  |j"                  #      }!t        |!      }"| j                  t        j                  d$      %       g }#| D ]D  }$|$j                  }%	 |"j                  |%      }&|&|% d|&j                   }%|#j                  |%       F |"| j                  || j                  |      &       djo                  |#      }'|'rtm        d'|'       |j                  r+|sJ | j                  |j                  ||j                         |j                  d*k(  r
t                tp        S # 1 sw Y   xY w# tv        $ r d}Y w xY wc c}w # t        $ r Y w xY w# t        $ rM}(| jN                  d(k\  })t        |(|)|j                         }*t        j                  |*|))       t        cY d }(~(S d }(~(ww xY w)+Nz'Can not combine '--user' and '--target'zto-satisfy-onlyT)check_targetzUsing %s)r9   r3   r8   isolated_modez=Target path exists but is not a directory, will not continue.target)kind)re   sessiontarget_pythonrN   install)deleterk   globally_managed)temp_build_dirre   build_trackerrl   finderr6   	verbosity)
preparerrs   re   wheel_cacher6   r?   rN   r>   r;   rP   )check_supported_wheels-)datawzutf-8)encoding   F)indentensure_asciic              3   X   K   | ]"  }|j                   d    |j                   d   f $ yw)nameversionN)metadata.0rs     rb   	<genexpr>z%InstallCommand.run.<locals>.<genexpr>  s/      - ZZ'I)>?-s   (*zWould install %s c              3   >   K   | ]  }d j                  |        yw)rx   N)join)r   items     rb   r   z%InstallCommand.run.<locals>.<genexpr>  s      PD$ Ps   pip)modifying_pip)rv   verifybuild_optionsrU   zYCould not build wheels for {}, which is required to install pyproject.toml-based projectsz, c              3   4   K   | ]  }|j                     y wN)r   r   s     rb   r   z%InstallCommand.run.<locals>.<genexpr>  s     !AQ!&&!As   )roothomeprefixrA   r6   	pycompile)userr   r   r   isolatedr   )key)resolver_variantzSuccessfully installed %s   )exc_infowarn)]r6   r3   r   r.   rC   r8   r9   rS   r   r:   r;   r	   check_dist_restrictionloggerverboser!   decide_user_installri   r?   ospathabspathexistsisdirr$   enter_contextrU   get_default_sessionr
   _build_package_finderrN   r   no_cleanget_requirementsr   r   	cache_dirpermit_editable_wheelsmake_requirement_preparerrt   make_resolverr>   rP   trace_basic_inforesolver   requirements_to_installr   to_dictopenjsondump#warn_legacy_versions_and_specifierssortedr#   r   r   get_requirementsatisfied_byKeyErrorr"   rG   valuesr(   r'   r   formatget_installation_orderignore_dependenciesrB   _determine_conflictsrA   r   r@   get_lib_location_guessesr   sortoperator
attrgetterr   get_distributionr   	Exceptionappend_warn_about_conflictsdetermine_resolver_variantOSErrorcreate_os_error_messageerrorr   _handle_target_dirr[   r   )+r`   re   rf   #installing_into_current_environmentr;   target_temp_dirtarget_temp_dir_pathrU   rl   rm   rs   rr   	directoryreqsrv   reqru   resolverrequirement_setreportfwould_install_itemspip_reqr   r   reqs_to_build_build_failures
to_install	conflictsshould_warn_about_conflictsrA   	installedlib_locationsenvitemsresultr   installed_distinstalled_descr   show_tracebackmessages+                                              rb   runzInstallCommand.run	  s5     W%7%7%CHII =W%=%=> ,!!T),""d*, ##t+	 	, 077$&,??&77))'Ez?#45 3!!++))''!//!
 48.2'+G$!#1C1C!DG w112GGMM'"4"45 #S 
 ,:O#2#7#7 / //52**73*73++'#*#A#A	 , 
 **+<+>?!'''!
	e	((wHD)'48$W%6%67K
  2-1*2 55(+%33.. 6 H ))!'%33!(!9!9'.'E'E ' 7 7!1"-- * H !!&)&..1C1C-C / O ''+O,S,ST++s2FNN$45g66gN URS		&.."2AaeTU   CCE&, -,DD- '# ' * P<O PP =)99%@ !( 4 4 <4=Q )55<<>3A6 M  !&' -!A~ '<<BF		!A.!AA=  "88IJ 48I///PG4P4P ( + 55jA	 $+#?#? !!W%8%8',$*&&)**%9%33!//	I 5**)&&** ..M "-0CNNx226:N;E# #{{%(%9%9$%?N%1"&q)?)?(@A T"# $**%)%D%DW%M + 
 !XXe_N/"  ""##""OW__ ##v-!CU U(  & %&D !    
	!^^q0N-%%G
 LL>L:L
	s   &E\
 4([A)\
 [$ 6\
 [6"E$\
 $[;+A\
 [!\
 $[3/\
 2[33\
 ;	\\
 \\
 
	] A]] ] r3   r   r:   c                    t        |       g }t        d|j                        }|j                  }|j                  }|j
                  }t        j                  j                  |      r|j                  |       t        j                  j                  |      r||k7  r|j                  |       t        j                  j                  |      r|j                  |       |D ]h  }	t        j                  |	      D ]L  }
|	|k(  r8t        j                  j                  ||
      t        fd|d d D              rAt        j                  j                  ||
      }t        j                  j                  |      r|st        j                  d|       t        j                  j                  |      rt        j                  d|       t        j                  j                  |      rt!        j"                  |       nt        j$                  |       t!        j&                  t        j                  j                  |	|
      |       O k y )N )r   c              3   @   K   | ]  }|j                          y wr   )
startswith)r   sddirs     rb   r   z4InstallCommand._handle_target_dir.<locals>.<genexpr>   s     I!1<<-Is   zKTarget directory %s already exists. Specify --upgrade to force replacement.zTarget directory %s already exists and is a link. pip will not automatically replace links, please remove if replacement is desired.)r    r   r   purelibplatlibry   r   r   r   listdirr   anyr   warningislinkr   shutilrmtreeremovemove)r`   r3   r   r:   lib_dir_listschemepurelib_dirplatlib_dirdata_dirlib_dirr   target_item_dirr   s               @rb   r   z!InstallCommand._handle_target_dir  s    	:  B_%9%9:nnnn;;77>>+&,77>>+&;++E,77>>(#)# 	JG

7+ Jh&77<<$7DI|CR7HII "$'',,z4"@77>>/2">+
 !ww~~o6' , !ww}}_5o6		/2BGGLL$7I9J	Jrd   r   c                 b    	 t        |      S # t        $ r t        j                  d       Y y w xY w)NzwError while checking for conflicts. Please file an issue on pip's issue tracker: https://github.com/pypa/pip/issues/new)r   r   r   	exception)r`   r   s     rb   r   z#InstallCommand._determine_conflicts;  s:    	*:66 	N 	s   
 ..conflict_detailsr   c                    |\  }\  }}|s|sy g }|dk(  r|j                  d       n|dk(  sJ |j                  d       |D ]<  }||   d   }||   D ]*  }	dj                  |||	d         }
|j                  |
       , > |D ]G  }||   d   }||   D ]5  \  }}}d	j                  ||||||dk(  rd
nd      }
|j                  |
       7 I t        j                  dj	                  |             y )Nlegacyzpip's legacy dependency resolver does not consider dependency conflicts when selecting packages. This behaviour is the source of the following dependency conflicts.z2020-resolverzpip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.r   z@{name} {version} requires {requirement}, which is not installed.r   )r   r   requirementzg{name} {version} requires {requirement}, but {you} have {dep_name} {dep_version} which is incompatible.youzyou'll)r   r   r  dep_namedep_versionr  
)r   r   r   criticalr   )r`   r  r   package_setmissingconflictingpartsproject_namer   
dependencyr   r  r  r   s                 rb   r   z$InstallCommand._warn_about_conflictsG  sV    /?++g{{x'LL@ $66LL@ $ 	&L!,/2G%l3 	&
.&%# *1    W%	&	& ( 	&L!,/2G.9,.G &*+sF&%# #% +"2o"E8    W%&	&  			%()rd   )r+   N)__name__
__module____qualname____doc__usagerc   r   r   r   strintr   r$   boolr   r   r   r   r   r    rd   rb   r*   r*   4   s    
0E
B y6 yc ys y yv4J4J0=4JHL4J	4Jl
12
	/	"
4* /4*CF4*	4*rd   r*   r   r   r   r   r   r+   c                 T    t        d| ||||      }|j                  |j                  gS )Nr   )r   r   r   r   r   )r   r   r   )r   r   r   r   r   r   s         rb   r   r   ~  s5     
F NNFNN++rd   c           	      N    t        d t        t        | |            D              S )Nc              3   2   K   | ]  }t        |        y wr   r   )r   ds     rb   r   z)site_packages_writable.<locals>.<genexpr>  s       	!s   r   r   )allsetr   r  s     rb   site_packages_writabler!    s)     -4(KL  rd   r6   r9   r3   r8   ri   c                    | | st         j                  d       y| r8|rt        d      t               rt	        d      t         j                  d       y| J |s|rt         j                  d       yt
        j                  st         j                  d       yt        ||	      rt         j                  d
       yt         j                  d       y)aZ  Determine whether to do a user install based on the input options.

    If use_user_site is False, no additional checks are done.
    If use_user_site is True, it is checked for compatibility with other
    options.
    If use_user_site is None, the default behaviour depends on the environment,
    which is provided by the other arguments.
    z$Non-user install by explicit requestFzVCan not combine '--user' and '--prefix' as they imply different installation locationszZCan not perform a '--user' install. User site-packages are not visible in this virtualenv.z User install by explicit requestTz3Non-user install due to --prefix or --target optionz4Non-user install because user site-packages disabledr  z0Non-user install because site-packages writeablezMDefaulting to user installation because normal site-packages is not writeable)	r   debugr   r&   r   siteENABLE_USER_SITEr!  info)r6   r9   r3   r8   ri   s        rb   r   r     s    " 	!M;<3   !#6  	78    jJK   KL 9}EGH
KK	 rd   r   r   using_user_sitec                    g }|j                  d       |s,|j                  d       |j                  t        |              n|j                  d       |dxx   dz  cc<   | j                  t        j                  k(  rUd}d}t	               s%|s#|j                  |d|j                         g       n|j                  |       |j                  d	       t        rR| j                  t        j                  k(  r5| j                  r)t        | j                        d
kD  r|j                  d       dj                  |      j                         dz   S )zrFormat an error message for an OSError

    It may occur anytime during the execution of the install command.
    z,Could not install packages due to an OSErrorz: .r   r	  z"Consider using the `--user` optionzCheck the permissionsz or z.
i  zHINT: This error might have occurred since this system does not have Windows Long Path support enabled. You can find information on how to enable this at https://pip.pypa.io/warnings/enable-long-paths
r   )r   r  errnoEACCESr%   extendlowerr   ENOENTfilenamelenr   strip)r   r   r'  r  user_option_partpermissions_parts         rb   r   r     s    E 
LL?@TSZ S 
"II {{ell"?2')/LL$$**, LL)*U
 	KK5<<'NN#%?	
 775>!D((rd   )FNNFN)NNNF)Lr*  r   r   r   r   r$  optparser   r   typingr   r   pip._vendor.richr   pip._internal.cacher   pip._internal.clir	   pip._internal.cli.cmdoptionsr
   pip._internal.cli.req_commandr   r   r   pip._internal.cli.status_codesr   r   pip._internal.exceptionsr   r   pip._internal.locationsr   pip._internal.metadatar   (pip._internal.models.installation_reportr   ,pip._internal.operations.build.build_trackerr   pip._internal.operations.checkr   r   pip._internal.reqr   pip._internal.req.req_installr   r   pip._internal.utils.compatr   pip._internal.utils.filesystemr   pip._internal.utils.loggingr   pip._internal.utils.miscr   r    r!   r"   r#   pip._internal.utils.temp_dirr$   pip._internal.utils.virtualenvr%   r&   pip._internal.wheel_builderr'   r(   r  r   r*   r  r  r   r!  r   r   r   r  rd   rb   <module>rK     s      	   * ! ' * ( ; 
 : D . 2 G J S 0 / < 1  7 P	8	G	*' G	*V  ,
,
3-, 3-, 	,
 SM, 
#Y,$# $ 4  "& $#:D>:#: : }	:
 : 
:z6)6)$(6);?6)6)rd   