관리-도구
편집 파일: direct_url_helpers.cpython-39.pyc
a ��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|J �|| j7 }| jr�|� 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 �subdirectory�join)r r �requirement� fragments� r ��/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/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�}|sJ �|�| j�\}}}|r>|s8J �|}n|sFJ �|�|�}t|t|j ||d�| j d�S | �� r�t| jt� | j d�S d }| j } | r�| � d| j� �}t| jt|d�| j d�S d S )N)r r �requested_revision)r r r �=)r )�is_vcsr �get_backend_for_scheme�scheme�get_url_rev_and_auth�url_without_fragment�get_revisionr r r �subdirectory_fragment�is_existing_dirr � hash_namer r ) r! r r"