
    5>qj                         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	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  e j*                  e      Z G d
 de	      Zy)    N)Values)
cmdoptions)make_target_python)RequirementCommandwith_cleanup)SUCCESS)get_build_tracker)
ensure_dirnormalize_pathwrite_output)TempDirectoryc                   @    e Zd ZdZdZd	dZededee	   de
fd       Zy)
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                   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                  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dt"        j$                  d       t        j&                  | j                          t        j(                  t        j*                  | j,                        }t        j(                  t        j.                  | j,                        }| j,                  j1                  d	|       | j,                  j1                  d	|       | j,                  j1                  d	| j                          y )
Nz-dz--destz--destination-dirz--destination-directorydownload_dirdirzDownload packages into <dir>.)destmetavardefaulthelpr   )cmd_opts
add_optionr   constraintsbuild_constraintsrequirementsrequirements_from_scriptsno_deps	only_depssrcrequire_hashesno_require_hashesprogress_barno_build_isolation
use_pep517check_build_depsignore_requires_pythonoscurdiradd_target_python_optionsmake_option_groupindex_groupparserpackage_selection_groupinsert_option_group)self
index_optsselection_optss      ^/opt/rentech/trading_bot/.venv/lib/python3.12/site-packages/pip/_internal/commands/download.pyadd_optionszDownloadCommand.add_options$   sE     !7!7!9:  !=!=!?@  !8!8!:;  !E!E!GH  !3!3!56  !5!5!78  !12  !:!:!<=  !=!=!?@  !8!8!:;  !>!>!@A  !6!6!89  !<!<!>?  !B!B!DE  %II0 	! 		
 	,,T]];11""KK


 $55..KK

 	'':6''>:''4==9    optionsargsc                    d|_         g |_        t        j                  |       t        j                  |       t        j
                  |       t        j                  |       t        |j                        |_        t        |j                         | j                  |      }t        |      }| j                  ||||j                        }| j                  t                     }t!        |j"                   dd      }| j%                  ||||      }| j'                  ||||||j                  d| j(                  d	      }	| j+                  |	|||j                  |j,                        }
| j/                  |       |
j1                  |d      }|	j3                  |j4                  j7                                g }|j4                  j7                         D ]I  }|j8                  |j:                  J |	j=                  |       |j?                  |j:                         K |rtA        d	d
jC                  |             tD        S )NT)r6   sessiontarget_pythonr'   download)deletekindglobally_managedF)	temp_build_dirr6   build_trackerr9   finderr   use_user_site	verbosityallow_editables)preparerrA   r6   r'   py_version_info)check_supported_wheelszSuccessfully downloaded %s )#ignore_installed	editablesr   check_dist_restrictioncheck_build_constraintscheck_release_control_exclusive(check_only_deps_option_does_not_conflictr   r   r
   get_default_sessionr   _build_package_finderr'   enter_contextr	   r   no_cleanget_requirementsmake_requirement_preparerrC   make_resolverpython_versiontrace_basic_inforesolve prepare_linked_requirements_morer   valuessatisfied_bynamesave_linked_requirementappendr   joinr   )r0   r6   r7   r9   r:   rA   r@   	directoryreqsrE   resolverrequirement_set
downloadedreqs                 r3   runzDownloadCommand.runO   s#   #'  ))'2**73227;;;GD-g.B.BC7''(**73*73++'#*#A#A	 , 
 **+<+>?!'''!
	 $$T7FGD11$' --nn! 2 

 %%#*#A#A#22 & 
 	f%"**4*M11/2N2N2U2U2WX "
"//668 	,C'xx+++005!!#((+		, 5sxx
7KLr5   )r   N)__name__
__module____qualname____doc__usager4   r   r   liststrintrf    r5   r3   r   r      sF    
0E):V F6 Fc Fs F Fr5   r   )loggingr(   optparser   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.utils.miscr
   r   r   pip._internal.utils.temp_dirr   	getLoggerrg   loggerr   ro   r5   r3   <module>r{      sG     	  ( ; J 2 J M M 6			8	$F( Fr5   