U
ÀÒ.eÉ ã @ s¢ d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
d dlmZ d d lmZmZmZ d d
lmZ e e¡ZG dd„ de ƒZdS )
é )Úabsolute_importN)Ú
cmdoptions)Úmake_target_python)ÚRequirementCommand)ÚRequirementSet)ÚRequirementTracker)Úcheck_path_owner)Ú
ensure_dirÚnormalize_pathÚwrite_output)Ú
TempDirectoryc s, e Zd ZdZdZ‡ fdd„Zdd„ Z‡ ZS )Ú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] [package-index-options] ...
%prog [options] -r [package-index-options] ...
%prog [options] ...
%prog [options] ...
%prog [options] ...c
sN t t| ƒj||Ž | j}| t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t
¡ ¡ | t ¡ ¡ | t ¡ ¡ | t
¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ | t ¡ ¡ |jddddddtjdd t |¡ t tj| j¡}| j d |¡ | j d |¡ d S )
Nz-dz--destz--destination-dirz--destination-directoryÚdownload_dirÚdirzDownload packages into .)ÚdestÚmetavarÚdefaultÚhelpr )Úsuperr
Ú__init__Úcmd_optsZ
add_optionr ZconstraintsZrequirementsÚ build_dirZno_depsZglobal_optionsZ no_binaryZonly_binaryZ
prefer_binaryÚsrcZpreÚno_cleanÚrequire_hashesZprogress_barZno_build_isolationZ
use_pep517Z
no_use_pep517ÚosÚcurdirZadd_target_python_optionsZmake_option_groupZindex_groupÚparserZinsert_option_group)ÚselfÚargsÚkwr Z
index_opts©Ú __class__© úC/usr/lib/python3.8/site-packages/pip/_internal/commands/download.pyr ) sF û
þzDownloadCommand.__init__c
C sL d|_ g |_t |¡ tj |j¡|_t|j ƒ|_ t
|j ƒ | |¡}t|ƒ}| j
|||d}|jph|j }|jrt|jƒst d|j¡ d |_tƒ ¬}t|j|dd}t|jd} | | ||||d ¡ | j||||j d}
| j|
||||jd}| | ¡ d d
d„ | jD ƒ¡}|r$td|ƒ |js4| ¡ 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.Zdownload)ÚdeleteZkind)r )Ztemp_build_dirr% Úreq_trackerr )ÚpreparerÚfinderr&