ó
Ð²Ebc           @@  s  d  d l  m Z d  d l Z d  d l 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 d  d
 l m Z e rã d  d l m Z d  d l m Z n  e j e ƒ Z d e	 f d „  ƒ  YZ d S(   i    (   t   absolute_importN(   t
   cmdoptions(   t   make_target_python(   t   RequirementCommandt   with_cleanup(   t   SUCCESS(   t   get_requirement_tracker(   t
   ensure_dirt   normalize_patht   write_output(   t   TempDirectory(   t   MYPY_CHECK_RUNNING(   t   Values(   t   Listt   DownloadCommandc           B@  s,   e  Z d  Z d Z d „  Z e d „  ƒ Z RS(   sL  
    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.
    s  
      %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> ...c         C@  sÓ  |  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 t j ƒ  ƒ |  j  j d d d d d d d d d	 t j d
 d ƒt j |  j  ƒ t j t j |  j ƒ } |  j j d | ƒ |  j j d |  j  ƒ d  S(   Ns   -ds   --dests   --destination-dirs   --destination-directoryt   destt   download_dirt   metavart   dirt   defaultt   helps   Download packages into <dir>.i    (   t   cmd_optst
   add_optionR   t   constraintst   requirementst	   build_dirt   no_depst   global_optionst	   no_binaryt   only_binaryt   prefer_binaryt   srct   pret   require_hashest   progress_bart   no_build_isolationt
   use_pep517t   no_use_pep517t   ost   curdirt   add_target_python_optionst   make_option_groupt   index_groupt   parsert   insert_option_group(   t   selft
   index_opts(    (    s<   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/download.pyt   add_options*   s6    		c         C@  sÉ  t  | _ g  | _ t j | ƒ t | j ƒ | _ t | j ƒ |  j | ƒ } t	 | ƒ } |  j
 d | d | d | ƒ } |  j t ƒ  ƒ } t d | j d d d t  ƒ } |  j | | | | ƒ } |  j d | d | d	 | d | d
 | d | j d t ƒ }	 |  j d |	 d
 | d | d | j ƒ }
 |  j | ƒ |
 j | d t  ƒ} g  } x[ | j j ƒ  D]J } | j d  k rX| j d  k	 s‚t ‚ |	 j | ƒ | j | j ƒ qXqXW| rÅt d d j | ƒ ƒ n  t  S(   Nt   optionst   sessiont   target_pythont   deletet   kindt   downloadt   globally_managedt   temp_build_dirt   req_trackert   finderR   t   use_user_sitet   preparert   py_version_infot   check_supported_wheelss   Successfully downloaded %st    (!   t   Truet   ignore_installedt	   editablesR   t   check_dist_restrictionR   R   R   t   get_default_sessionR   t   _build_package_findert   enter_contextR   R
   t   no_cleant   get_requirementst   make_requirement_preparert   Falset   make_resolvert   python_versiont   trace_basic_infot   resolveR   t   valuest   satisfied_byt   Nonet   namet   AssertionErrort   save_linked_requirementt   appendR	   t   joinR   (   R-   R0   t   argsR1   R2   R9   R8   t	   directoryt   reqsR;   t   resolvert   requirement_sett
   downloadedt   req(    (    s<   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/download.pyt   runN   sT    				
					(   t   __name__t
   __module__t   __doc__t   usageR/   R   R]   (    (    (    s<   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/download.pyR      s   	$(   t
   __future__R    t   loggingR&   t   pip._internal.cliR   t   pip._internal.cli.cmdoptionsR   t   pip._internal.cli.req_commandR   R   t   pip._internal.cli.status_codesR   t   pip._internal.req.req_trackerR   t   pip._internal.utils.miscR   R   R	   t   pip._internal.utils.temp_dirR
   t   pip._internal.utils.typingR   t   optparseR   t   typingR   t	   getLoggerR^   t   loggerR   (    (    (    s<   /tmp/pip-build-UPPWic/pip/pip/_internal/commands/download.pyt   <module>   s   