관리-도구
편집 파일: download.cpython-38.pyc
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] <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�� � |jddddddtjdd� t�|� t�tj| j�}| j�d |� | j�d |� d S ) Nz-dz--destz--destination-dirz--destination-directory�download_dir�dirzDownload packages into <dir>.)�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 }|jr�t|j�s�t�d|j� d |_t� ��}t|j|dd���}t|jd�} | �| ||||d � | j||||j d�} | j| ||||jd�}|�| � d �d d� | jD ��}|�r$td|� |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.Zdownload)�deleteZkind)r )Ztemp_build_dirr% �req_trackerr )�preparer�finderr&