관리-도구
편집 파일: utils.cpython-38.pyc
U &?�f� � @ s. d dl mZ d dlZd dlmZmZmZmZ ddlm Z m Z ddlmZm Z eed eeef f Zede�ZG d d � d e�ZG dd� de�ZG d d� de�Ze�dej�Ze�d�Ze�d�Ze�d�Zdd�dddd�dd�Zddd�dd�Zdd�dddd �d!d"�Zdd#d$�d%d&�Zdd'd$�d(d)�Z dS )*� )�annotationsN)�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 �I/opt/hc_python/lib/python3.8/site-packages/pip/_vendor/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�str�bool)�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_name5 s r&