
    Mg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-ZKdS )0    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dS )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                 X   | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             ddddd           | j                             ddd	d
d d           t          j        | j                    | j                             dddd           | j                             dddt                     | j                             ddd
d d           | j                             ddd
d d           | j                             t          j
                               | j                             ddddd           | j                             ddddd gd!"           | j                             d#d$dd%           | j                             d&d'd(dd)           | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             d*dd+d,d-           | j                             d.dd+d/0           | j                             d1dd2d,d3           | j                             d4dd5d,d6           | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               | j                             t          j                               t          j        t          j        | j                  }| j                            d7|           | j                            d7| j                    | j                             d8d9d:d d;           d S )<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     j/var/www/html/nodeJS/PythonScripts/venv3.11/lib/python3.11/site-packages/pip/_internal/commands/install.pyadd_optionszInstallCommand.add_optionsH   s     !8!:!:;;;  !7!9!9:::  !3!5!5666  !1!1222  !4!6!6777  1 	! 
	
 
	
 
	
 	  % 	! 	
 	
 	
 	,T];;;   % 	! 
	
 
	
 
	
 	    	 	! 	
 	
 	
 	  P 	! 	
 	
 	
 	   	! 	
 	
 	
  	  !1!1222  ) 	! 
	
 
	
 
	
 	   #$%w/G 	! 	
 	
 	
  	  "N	 	! 	
 	
 	
 	   #4 	! 	
 	
 	
 	  !B!D!DEEE  !>!@!@AAA  !6!8!8999  !9!;!;<<<  !<!>!>???  !G!I!IJJJ  !;!=!=>>>  !:!<!<===  : 	! 	
 	
 	
 	   A	 	! 	
 	
 	
 	  ' 'C 	! 	
 	
 	
 	  ! '8 	! 	
 	
 	
 	  !5!7!7888  !7!9!9:::  !9!;!;<<<  !:!<!<===  !8!:!:;;;  !<!>!>???1"K
 


 	'':666''4=999  #G 	! 	
 	
 	
 	
 	
    optionsargsc                    |j         r|j        t          d          |j        o|j         o|j        d u o|j        d u o|j        d u }|r|j        st                       d}|j	        r|j
        }t          j        |d           t                              dt                                 t!          |j         |j        |j        |j        |j                  |_         d }d }|j        rd|_        t&          j                            |j                  |_        t&          j                            |j                  r3t&          j                            |j                  st          d          t1          d	          }|j        }|                     |           |j        pg }|                     |          }t9          |          }	|                     |||	|j        
          }
|                     t?                                }t1          |j          dd          }	 | !                    |||
|          }tE          ||           tG          |j$                  }|D ]	}d|_%        
| &                    |||||
|j         | j'                  }| (                    ||
|||j         |j        |j        |j)        ||j*        
  
        }| +                    |
           |,                    ||j                   }|j        rt[          |j.                  }|j        dk    r#t_          |0                                           nYtc          |j        dd          5 }te          j3        |0                                |dd           d d d            n# 1 swxY w Y   |j        rh|4                                 tk          d |j.        D                       }|r-tm          dd7                    d |D                                  tp          S 	 |9                    d          }|j:        d u }n# tv          $ r d}Y nw xY wty          |           d |j=        >                                D             }t          ||dg |          \  }}|r?t          d A                    d!7                    d" |D                                           |B                    |          }d }|jC         o|jD        }|r| E                    |          }|jF        }|j        s|j        rd}t          |||j        ||j        ||j         |jH        #          }t          |j         ||j        |j        |j        $          } t          |           }!|K                    t          jM        d%          &           g }"|D ]S}#|#jN        }$	 |!O                    |$          }%|%|$ d|%jP         }$n# t          $ r Y nw xY w|"R                    |$           T|*| S                    || T                    |          '           d7                    |"          }&|&rtm          d(|&           n[# t          $ rN}'| j'        d)k    }(t          |'|(|j                   })t          W                    |)|(*           t          cY d }'~'S d }'~'ww xY w|j        r%|sJ | Y                    |j        ||j	                   |jZ        d+k    rt                       tp          S ),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   J   K   | ]}|j         d          |j         d         fV  dS )nameversionN)metadata.0rs     rb   	<genexpr>z%InstallCommand.run.<locals>.<genexpr>  sI       - - Z'I)>?- - - - - -rd   zWould install %s c              3   @   K   | ]}d                      |          V  dS )rx   N)join)r   items     rb   r   z%InstallCommand.run.<locals>.<genexpr>  s,       P PD$ P P P P P Prd   pip)modifying_pipc                 0    g | ]}t          |          |S  )r(   r   s     rb   
<listcomp>z&InstallCommand.run.<locals>.<listcomp>  s6       3A66  rd   )rv   verifybuild_optionsrU   zYCould not build wheels for {}, which is required to install pyproject.toml-based projectsz, c              3   $   K   | ]}|j         V  d S N)r   r   s     rb   r   z%InstallCommand.run.<locals>.<genexpr>  s$      !A!AQ!&!A!A!A!A!A!Ard   )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   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   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	  s     	JW%7%CHIII =W%=> ,!T),"d*, #t+	 	, 0	'7	' %&&&,? 	8&7)'EEEEz?#4#4555 3!+)'!/!
 !
 !
 48.2 	0'+G$!#1C!D!DG w122 GMM'"455 #S  
 ,:::O#2#7 /// /52**733*733++'#*#A	 , 
 
 **+<+>+>??!''!
 
 
	e	((wHHD)'4888$W%677K
  2 2-1**55(+%3. 6  H ))!'%3!(!9'.'E ' 7!1"- *  H !!&)))&..1C-C /  O ' U+O,STT+s22FNN$4$455555g6gNNN URS	&.."2"2AaeTTTTU U U U U U U U U U U U U U U    CCEEE&, - -,D- - - ' '# '  * P P<O P P PPP   =)99%@@ !( 4 <  & & & %& 5=QQQQ (5<<>>  M !&' -! ! !A~  '<<BF		!A!A.!A!A!AAA= =   "88IIJ 48I//PG4P ( + B 55jAA	 $+#? ! -W%8 -',$*&)*%9%3!/	 	 	I 5*)&* .  M "-00CNNx26::N;;;E# # #{%(%9%9$%?%?N%1"&AA)?AA    DT""""$**%)%D%DW%M%M +   
 !XXe__N /"    
	 
	 
	!^q0N-% G
 LL>L:::LLLLLL
	  	""""##"OW_   #v--!!!s   !D8Y +NY NY NA1Y P*  
Y *P96Y 8P99E9Y 3#WY 
W$!Y #W$$A,Y 
Z)AZ$Z)$Z)r3   r   r:   c                    t          |           g }t          d|j                  }|j        }|j        }|j        }t          j                            |          r|                    |           t          j                            |          r||k    r|                    |           t          j                            |          r|                    |           |D ]y}	t          j	        |	          D ]`}
|	|k    rDt          j        
                    ||
          t          fd|d d         D                       rMt          j        
                    ||
          }t          j                            |          r|st                              d|           t          j                            |          rt                              d|           t          j                            |          rt!          j        |           nt          j        |           t!          j        t          j        
                    |	|
          |           b{d S )N )r   c              3   B   K   | ]}|                               V  d S r   )
startswith)r   sddirs     rb   r   z4InstallCommand._handle_target_dir.<locals>.<genexpr>   s/      II!1<<--IIIIIIrd   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  sL    	:  B_%9:::nn;7>>+&& 	-,,,7>>+&& 	-;++E+E,,,7>>(## 	*)))# 	J 	JG
7++ J Jh&&7<<$77DIIII|CRC7HIIIII ! "$',,z4"@"@7>>/22 3" !>+  
 !w~~o66 !' ,   !w}}_55 3o6666	/222BGLL$77IIII9J	J 	Jrd   r   c                 x    	 t          |          S # t          $ r t                              d           Y d S 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;  sW    	*:666 	 	 	N   44	s    $99conflict_detailsr   c                 H   |\  }\  }}|s|sd S g }|dk    r|                     d           n|dk    sJ |                     d           |D ]N}||         d         }||         D ]5}	d                    |||	d                   }
|                     |
           6O|D ]W}||         d         }||         D ]>\  }}}d	                    ||||||dk    rd
nd          }
|                     |
           ?Xt                              d                    |                     d S )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  s    /?++g{ 	{ 	Fx''LL@    $6666LL@   $ 	& 	&L!,/2G%l3 	& 	&
.&%# *1     W%%%%	& ( 	& 	&L!,/2G.9,.G & &*+sF&%# #% +"2o"E"E8     W%%%%& 			%(()))))rd   )r+   N)__name__
__module____qualname____doc__usagerc   r   r   r   strintr   r$   boolr   r   r   r   r   r   r   rd   rb   r*   r*   4   s       
 
0E
 
 
 
B y6 yc ys y y y \yv4J4J0=4JHL4J	4J 4J 4J 4Jl
12
	/	"
 
 
 
4* /4*CF4*	4* 4* 4* 4* 4* 4*rd   r*   Fr   r   r   r   r   r+   c                 H    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   ~  s;     
  F NFN++rd   c           	      l    t          d t          t          | |                    D                       S )Nc              3   4   K   | ]}t          |          V  d S r   r   )r   ds     rb   r   z)site_packages_writable.<locals>.<genexpr>  s>         	!     rd   r   r   )allsetr   r   s     rb   site_packages_writabler#    sF      -4(KKKLL     rd   r6   r9   r3   r8   ri   c                    | | st                               d           dS | rJ|rt          d          t                      rt	          d          t                               d           dS | J |s|rt                               d           dS t
          j        st                               d	           dS t          ||
          rt                               d           dS t                               d           dS )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.
    Nz$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!;<<<u  	3    !! 	#6   	7888t      j JKKKu   KLLLu 9}EEE GHHHu
KK	   4rd   r   r   using_user_sitec                    g }|                     d           |s8|                     d           |                     t          |                      n|                     d           |dxx         dz  cc<   | j        t          j        k    rid}d}t	                      s-|s+|                    |d|                                g           n|                     |           |                     d	           t          rI| j        t          j        k    r4| j	        r-t          | j	                  d
k    r|                     d           d                    |                                          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ZZ    S 
"IIIIII {el""?2')) 		+/ 		+LL$$**,,    LL)***U
 	
K5<''N (#%%?	
 	
 	
 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>rM     s      				   * * * * * * * * ! ! ! ! ! ! ! ! ' ' ' ' ' ' * * * * * * ( ( ( ( ( ( ; ; ; ; ; ;         
 : 9 9 9 9 9 9 9 D D D D D D D D . . . . . . 2 2 2 2 2 2 G G G G G G J J J J J J S S S S S S S S 0 0 0 0 0 0        / . . . . . < < < < < < 1 1 1 1 1 1              7 6 6 6 6 6        P O O O O O O O	8		G	* G	* G	* G	* G	*' G	* G	* G	*V  , ,
,
3-, 3-, 	,
 SM, 
#Y, , , ,$# $ 4     "& $#: :D>:#: : }	:
 : 
: : : :z6)6)$(6);?6)6) 6) 6) 6) 6) 6)rd   