관리-도구
편집 파일: direct_url_helpers.cpython-38.pyc
U ʗRe� � @ s� d dl mZ d dlmZmZmZmZ d dlmZ d dl m Z d dlmZ ee e d�dd�Ze ed �d d�Zdeee eed�dd�ZdS )� )�Optional)�ArchiveInfo� DirectUrl�DirInfo�VcsInfo)�Link)�path_to_url)�vcs)� direct_url�name�returnc C s� | � � |d }g }t| jt�r>|d�| jj| j| jj�7 }nHt| jt�rl|| j7 }| jj r�|� | jj � nt| jt�s|t�|| j7 }| j r�|� d| j � |r�|dd�|� 7 }|S )z0Convert a DirectUrl to a pip requirement string.z @ z{}+{}@{}z subdirectory=�#�&)�validate� isinstance�infor �formatr �url� commit_idr �hash�appendr �AssertionError�subdirectory�join)r r �requirement� fragments� r ��/builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_internal/utils/direct_url_helpers.py�%direct_url_as_pep440_direct_reference s( � r )� source_dirr c C s t t| �tdd�d�S )NT)�editable)r r )r r r )r r r r �direct_url_for_editable s �r! NF)�linkr �link_is_in_wheel_cacher c C s� | j rlt�| j�}|st�|�| j�\}}}|r>|s8t�|}n|sFt�|�|�}t|t |j ||d�| jd�S | �� r�t| jt � | jd�S d }| j} | r�| � d| j� �}t| jt|d�| jd�S d S )N)r r �requested_revision)r r r �=)r )�is_vcsr �get_backend_for_scheme�schemer �get_url_rev_and_auth�url_without_fragment�get_revisionr r r �subdirectory_fragment�is_existing_dirr � hash_namer r ) r"