
    e                         d dl Z d dl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 d d	lmZmZ d d
lmZmZmZ d dlmZ  e j        e          Z G d de          ZdS )    N)Values)List)
cmdoptions)make_target_python)RequirementCommandwith_cleanup)SUCCESS)get_build_tracker)LegacySetupPyOptionsCheckModecheck_legacy_setup_py_options)
ensure_dirnormalize_pathwrite_output)TempDirectoryc                   N    e Zd ZdZdZd	dZededee	         de
fd            ZdS )
DownloadCommandaL  
    Download packages from:

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

    pip also supports downloading from "requirements files", which provide
    an easy way to specify a whole environment to be downloaded.
    a  
      %prog [options] <requirement specifier> [package-index-options] ...
      %prog [options] -r <requirements file> [package-index-options] ...
      %prog [options] <vcs project url> ...
      %prog [options] <local project path> ...
      %prog [options] <archive url/path> ...returnNc           
         | 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                             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dt&          j        d           t          j        | j                    t          j        t          j        | j                  }| j                            d	|           | j                            d	| j                    d S )
Nz-dz--destz--destination-dirz--destination-directorydownload_dirdirzDownload packages into <dir>.)destmetavardefaulthelpr   )cmd_opts
add_optionr   constraintsrequirementsno_depsglobal_options	no_binaryonly_binaryprefer_binarysrcprerequire_hashesprogress_barno_build_isolation
use_pep517no_use_pep517check_build_depsignore_requires_pythonoscurdiradd_target_python_optionsmake_option_groupindex_groupparserinsert_option_group)self
index_optss     V/var/www/html/api/venv/lib/python3.11/site-packages/pip/_internal/commands/download.pyadd_optionszDownloadCommand.add_options)   s     !7!9!9:::  !8!:!:;;;  !3!5!5666  !:!<!<===  !5!7!7888  !7!9!9:::  !9!;!;<<<  !1!1222  !1!1222  !:!<!<===  !8!:!:;;;  !>!@!@AAA  !6!8!8999  !9!;!;<<<  !<!>!>???  !B!D!DEEE  %I0 	! 		
 		
 		
 	,T];;;1"K
 


 	'':666''4=99999    optionsargsc           
         d|_         g |_        t          j        |           t	          |j                  |_        t          |j                   |                     |          }t          |          }| 	                    ||||j
                  }|                     t                                }t          |j         dd          }|                     ||||          }t!          ||t"          j                   |                     ||||||j        d| j                  }	|                     |	|||j
        |j        |j                  }
|                     |           |
                    |d          }g }|j                                        D ]A}|j        8|j        J |	                    |           |                    |j                   B|r#tA          d	d
!                    |                     tD          S )NT)r9   sessiontarget_pythonr,   download)deletekindglobally_managedF)temp_build_dirr9   build_trackerr<   finderr   use_user_site	verbosity)preparerrD   r9   r,   r)   py_version_info)check_supported_wheelszSuccessfully downloaded %s )#ignore_installed	editablesr   check_dist_restrictionr   r   r   get_default_sessionr   _build_package_finderr,   enter_contextr
   r   no_cleanget_requirementsr   r   DOWNLOADmake_requirement_preparerrF   make_resolverr)   python_versiontrace_basic_inforesolver   valuessatisfied_bynamesave_linked_requirementappendr   joinr	   )r4   r9   r:   r<   r=   rD   rC   	directoryreqsrG   resolverrequirement_set
downloadedreqs                 r6   runzDownloadCommand.runP   s9    $(  )'222-g.BCC7'(((**733*733++'#*#A	 , 
 
 **+<+>+>??!''!
 
 
	 $$T7FGDD%T8A	
 	
 	
 11$' -n 2 	
 	
 %%#*#A)#2 & 
 
 	f%%%"**4*MM "
"/6688 	, 	,C'x+++00555!!#(+++ 	M5sxx
7K7KLLLr8   )r   N)__name__
__module____qualname____doc__usager7   r   r   r   strintre    r8   r6   r   r      s|        
 
0E%: %: %: %:N D6 Dc Ds D D D \D D Dr8   r   )loggingr-   optparser   typingr   pip._internal.clir   pip._internal.cli.cmdoptionsr   pip._internal.cli.req_commandr   r   pip._internal.cli.status_codesr	   ,pip._internal.operations.build.build_trackerr
   pip._internal.req.req_installr   r   pip._internal.utils.miscr   r   r   pip._internal.utils.temp_dirr   	getLoggerrf   loggerr   rm   r8   r6   <module>r{      sG    				             ( ( ( ( ( ( ; ; ; ; ; ; J J J J J J J J 2 2 2 2 2 2 J J J J J J        N M M M M M M M M M 6 6 6 6 6 6		8	$	$@ @ @ @ @( @ @ @ @ @r8   