File: //usr/lib/python3.9/site-packages/pip/_internal/commands/__pycache__/download.cpython-39.pyc
a
?�f6 � @ s� d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z m
Z
d dlmZ d dl
mZ d dlmZmZmZ d d lmZ d d
lmZ er�d dlmZ d dlmZ e�e�ZG d
d� de �ZdS )� )�absolute_importN)�
cmdoptions)�make_target_python)�RequirementCommand�with_cleanup)�SUCCESS)�get_requirement_tracker)�
ensure_dir�normalize_path�write_output)�
TempDirectory)�MYPY_CHECK_RUNNING)�Values)�Listc @ s( e Zd ZdZdZdd� Zedd� �ZdS )�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
C sL | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j �t� � � | j �t�
� � | j �t�� � | j �t�� � | j �t�
� � | j �t�� � | j �t�� � | j �t�� � | j �t�� � | j jddddddtjdd� t�| j � t�tj| j�}| j�d |� | j�d | j � d S )
Nz-dz--destz--destination-dirz--destination-directory�download_dir�dirzDownload packages into <dir>.)�dest�metavar�default�helpr )Zcmd_optsZ
add_optionr �constraints�requirements� build_dirZno_depsZglobal_optionsZ no_binaryZonly_binaryZ
prefer_binary�srcZpreZrequire_hashesZprogress_barZno_build_isolationZ
use_pep517Z
no_use_pep517�os�curdirZadd_target_python_optionsZmake_option_groupZindex_group�parserZinsert_option_group)�selfZ
index_opts� r �C/usr/lib/python3.9/site-packages/pip/_internal/commands/download.py�add_options* s: ��zDownloadCommand.add_optionsc C s� d|_ g |_t�|� t|j�|_t|j� | �|�}t|�}| j |||d�}|j
pX|j }| �t
� �}t|j|ddd�}| �||||�} | j||||||jdd�}
| j|
|||jd�}| �|� |j| dd�}d �d
d� |j�� D ��}
|
r�td|
� tS )
NT)�options�session�
target_pythonZdownload)�delete�kindZglobally_managedF)Ztemp_build_dirr"