관리-도구
편집 파일: req_install.cpython-36.pyc
3 �Re�� � @ sD d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlm Z m Z d dlmZ d dl mZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d d lmZ d dl!m"Z# d dl$m%Z% d dl$m&Z' d dl(m)Z) d dl*m+Z+m,Z, d dl-m.Z. d dl/m0Z0 d dl1m2Z2 d dl3m4Z4 d dl5m6Z6 d dl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZA d dlBmCZC d dlDmEZEmFZF d dlGmHZH d dlImJZJ d dlKmLZL eH�rd dlMmNZNmOZOmPZPmQZQmRZRmSZSmTZT d dlmUZU d d lVmWZW d d!lXmYZY d d"lZm[Z[ ej\e]�Z^d#d$� Z_G d%d&� d&e`�Zad'd(� ZbdS ))� )�absolute_importN)� pkg_resources�six)�Requirement)�canonicalize_name)�Version)�parse)�Pep517HookCaller)�NoOpBuildEnvironment)�InstallationError)� get_scheme)�Link)�generate_metadata)�install_editable)�LegacyInstallFailure)�install)� install_wheel)�load_pyproject_toml�make_pyproject_path)�UninstallPathSet)� deprecated)�direct_url_from_link)�Hashes)� indent_log) �ask_path_exists� backup_dir�display_path�dist_in_install_path�dist_in_site_packages�dist_in_usersite�get_distribution�get_installed_version�hide_url�redact_auth_from_url)�get_metadata)� TempDirectory� tempdir_kinds)�MYPY_CHECK_RUNNING)�running_under_virtualenv)�vcs)�Any�Dict�Iterable�List�Optional�Sequence�Union)�BuildEnvironment)�Distribution)�SpecifierSet)�Markerc C s� | j tj�}tjj|�\}}tj||�}|jd�rJtj}tjj |�d }n.|jd�sXt �tj}tjj |�d jd�d }||||d�S )zQReturn a pkg_resources.Distribution for the provided metadata directory. z .egg-infor z .dist-info�-)�project_name�metadata)�rstrip�os�sep�path�splitr �PathMetadata�endswithr2 �splitext�AssertionError�DistInfoDistribution)�metadata_directory�dist_dir�base_dir� dist_dir_namer7 �dist_cls� dist_name� rH ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_install.py� _get_distE s rJ c @ s\ e Zd ZdZdddddddddf dfdd�Zdd� Zdd � Zd d� Zedd � �Z edd� �Z edd� �Zedd� �ZdEdd�Z edd� �ZdFdd�Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zed%d&� �Zed'd(� �Zed)d*� �Zed+d,� �Zd-d.� Zd/d0� Zd1d2� Zed3d4� �Zd5d6� Zd7d8� ZdGd9d:�ZdHd;d<�Z dId=d>�Z!d?d@� Z"dAdB� Z#dJdCdD�Z$dS )K�InstallRequirementz� Represents something that may be installed later on, may have information about where to fetch the relevant requirement and also contains logic for installing the said requirement. FNc C s� |d kst |t�st|��|| _|| _|| _|| _d | _d | _| jrj|sLt�|j rjt jjt jj |j��| _|d kr�|r�|jr�t|j�}| | _| _d| _d | _| jr�| jj r�| jj| _|r�|| _n |r�dd� |jD �| _nt� | _|d kr�|r�|j}|| _d | _d| _d | _d | _|�r|ng | _| �r,| ng | _| �r<| ni | _d| _ | | _!d| _"|| _#t$� | _%d | _&d | _'g | _(d | _)|| _*d S )NFc S s h | ]}t j|��qS rH )r � safe_extra)�.0�extrarH rH rI � <setcomp>� s z.InstallRequirement.__init__.<locals>.<setcomp>)+� isinstancer r@ �req� comes_from� constraint�editable�legacy_install_reason� source_dir�is_filer9 r; �normpath�abspath� file_path�urlr �link� original_link�original_link_is_in_wheel_cache�local_file_path�extras�set�marker�markers�satisfied_by�should_reinstall�_temp_build_dir�install_succeeded�install_options�global_options�hash_options�prepared� user_supplied�successfully_downloaded�isolatedr � build_envrB �pyproject_requires�requirements_to_check�pep517_backend� use_pep517)�selfrQ rR rT r\ rc rs rn rh ri rj rS r` rl rH rH rI �__init__g sZ zInstallRequirement.__init__c C s� | j r.t| j �}| jrF|djt| jj��7 }n| jrBt| jj�}nd}| jd k rf|djt| jj��7 }| j r�t | j tj�r�| j }n | j j � }|r�|dj|�7 }|S )Nz from {}z<InstallRequirement>z in {}z (from {}))rQ �strr\ �formatr# r[ rd r �locationrR rP r �string_types� from_path)rt �srR rH rH rI �__str__� s zInstallRequirement.__str__c C s dj | jjt| �| j�S )Nz<{} object: {} editable={!r}>)rw � __class__�__name__rv rT )rt rH rH rI �__repr__� s zInstallRequirement.__repr__c s>