<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    ÀÒ.eÉ  ã                   @   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	 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 e e¡ZG dd„ de	ƒZdS )é    )Úabsolute_importN)Ú
cmdoptions)Úmake_target_python)ÚRequirementCommand)ÚRequirementSet)ÚRequirementTracker)Úcheck_path_owner)Ú
ensure_dirÚnormalize_pathÚwrite_output)ÚTempDirectoryc                       s,   e Zd ZdZdZ‡ fdd„Zdd„ Z‡  Z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> ...c              
      sN  t t| ƒj||Ž | j}| t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t 	¡ ¡ | t 
¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ |jddddddtjdd t |¡ t tj| j¡}| j d	|¡ | j d	|¡ d S )
Nz-dz--destz--destination-dirz--destination-directoryÚdownload_dirÚdirzDownload packages into <dir>.)ÚdestÚmetavarÚdefaultÚhelpr   )Úsuperr   Ú__init__Úcmd_optsZ
add_optionr   ZconstraintsZrequirementsÚ	build_dirZno_depsZglobal_optionsZ	no_binaryZonly_binaryZprefer_binaryÚsrcZpreÚno_cleanÚrequire_hashesZprogress_barZno_build_isolationZ
use_pep517Zno_use_pep517ÚosÚcurdirZadd_target_python_optionsZmake_option_groupZindex_groupÚparserZinsert_option_group)ÚselfÚargsÚkwr   Z
index_opts©Ú	__class__© úC/usr/lib/python3.8/site-packages/pip/_internal/commands/download.pyr   )   sF       û
þzDownloadCommand.__init__c              
   C   sL  d|_ g |_t |¡ tj |j¡|_t|j	ƒ|_	t
|j	ƒ |  |¡}t|ƒ}| j|||d}|jph|j }|jrt|jƒst d|j¡ d |_tƒ ¬}t|j|dd}t|jd}	|  |	||||d ¡ | j||||j	d}
| j|
||||jd}| |	¡ d	 d
d„ |	jD ƒ¡}|r$td|ƒ |js4|	  ¡  W 5 Q R X W 5 Q R X |	S )NT)ÚoptionsÚsessionÚtarget_pythonzÝThe directory '%s' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.Zdownload)ÚdeleteZkind)r   )Ztemp_build_dirr%   Úreq_trackerr   )ÚpreparerÚfinderr&   r%   Zpy_version_infoú c                 S   s   g | ]
}|j ‘qS r#   )Úname)Ú.0Zreqr#   r#   r$   Ú
<listcomp>’   s    z'DownloadCommand.run.<locals>.<listcomp>zSuccessfully downloaded %s)!Zignore_installedZ	editablesr   Zcheck_dist_restrictionr   ÚpathÚabspathZsrc_dirr
   r   r	   Zget_default_sessionr   Z_build_package_finderr   r   Ú	cache_dirr   ÚloggerZwarningr   r   r   r   Zpopulate_requirement_setZmake_requirement_preparerZmake_resolverZpython_versionZresolveÚjoinZsuccessfully_downloadedr   Zcleanup_files)r   r%   r   r&   r'   r+   Zbuild_deleter)   Z	directoryZrequirement_setr*   ZresolverZ
downloadedr#   r#   r$   ÚrunQ   sv    


ýú
  ÿÿú	üû

ÿ
zDownloadCommand.run)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Zusager   r5   Ú__classcell__r#   r#   r!   r$   r      s   (r   )Z
__future__r   Zloggingr   Zpip._internal.clir   Zpip._internal.cli.cmdoptionsr   Zpip._internal.cli.req_commandr   Zpip._internal.reqr   Zpip._internal.req.req_trackerr   Zpip._internal.utils.filesystemr   Zpip._internal.utils.miscr	   r
   r   Zpip._internal.utils.temp_dirr   Z	getLoggerr6   r3   r   r#   r#   r#   r$   Ú<module>   s   
