관리-도구
편집 파일: utils.cpython-38.pyc
U -?�f� � @ sF d dl Z d dlmZmZmZmZmZ ddlmZm Z ddl mZmZ eed ee ef f Zede�ZG dd � d e�ZG d d� de�ZG dd � d e�Ze �de j�Ze �d�Ze �d�Ze �d�Zdd�eeed�dd�Zeed�dd�Zdd�eeef eed�dd�Zeeeeeee f d�d d!�Zeeeef d�d"d#�Z dS )$� N)� FrozenSet�NewType�Tuple�Union�cast� )�Tag� parse_tag)�InvalidVersion�Version� �NormalizedNamec @ s e Zd ZdZdS )�InvalidNamezW An invalid distribution name; users should refer to the packaging user guide. N��__name__� __module__�__qualname__�__doc__r r r �L/opt/hc_python/lib/python3.8/site-packages/wheel/vendored/packaging/utils.pyr s r c @ s e Zd ZdZdS )�InvalidWheelFilenamezM An invalid wheel filename was found, users should refer to PEP 427. Nr r r r r r s r c @ s e Zd ZdZdS )�InvalidSdistFilenamez^ An invalid sdist filename was found, users should refer to the packaging user guide. Nr r r r r r s r z)^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$z[-_.]+z/^([a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9])$z (\d+)(.*)F)�validate)�namer �returnc C s6 |rt �| �std| ����t�d| ��� }tt|�S )Nzname is invalid: �-)�_validate_regex�matchr �_canonicalize_regex�sub�lowerr r )r r �valuer r r �canonicalize_name+ s r! )r r c C s t �| �d k S �N)�_normalized_regexr )r r r r �is_normalized_name3 s r$ T)�strip_trailing_zero)�versionr% r c C s t | t�r2zt| �}W q6 tk r. | Y S X n| }g }|jdkrV|�|j� d�� d�dd� |jD ��}|r~t� dd|�}|�|� |j dk r�|�d�d d� |j D ��� |jdk r�|�d |j� �� |jdk r�|�d|j� �� |j dk �r|�d|j � �� d�|�S ) z� This is very similar to Version.__str__, but has one subtle difference with the way it handles the release segment. r �!�.c s s | ]}t |�V qd S r"