관리-도구
편집 파일: utils.cpython-311.pyc
� �܋f� � � � d dl Z d dlmZmZmZmZmZ ddlmZm Z ddl mZmZ eed ee ef f Z ede� � Z G d� d e� � Z G d � de� � Z G d� d e� � Z e j de j � � Z e j d� � Z e j d� � Z e j d� � Zdd�dededefd�Zdedefd�Zdd�deeef dedefd�Zdedeeeeee f fd�Zdedeeef fd �Z dS )!� N)� FrozenSet�NewType�Tuple�Union�cast� )�Tag� parse_tag)�InvalidVersion�Version� �NormalizedNamec � � e Zd ZdZdS )�InvalidNamezW An invalid distribution name; users should refer to the packaging user guide. N��__name__� __module__�__qualname__�__doc__r � �\/opt/cloudlinux/venv/lib64/python3.11/site-packages/pkg_resources/_vendor/packaging/utils.pyr r � � � � � � �� � � r r c � � e Zd ZdZdS )�InvalidWheelFilenamezM An invalid wheel filename was found, users should refer to PEP 427. Nr r r r r r r r r c � � e Zd ZdZdS )�InvalidSdistFilenamez^ An invalid sdist filename was found, users should refer to the packaging user guide. Nr r r r r r r r 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 �� � |r,t � | � � st d| ��� � �t � d| � � � � � }t t |� � S )Nzname is invalid: �-)�_validate_regex�matchr �_canonicalize_regex�sub�lowerr r )r r �values r �canonicalize_namer( + sg � �� 8��-�-�d�3�3� 8��6�d�6�6�7�7�7��#�#�C��.�.�4�4�6�6�E����&�&�&r c �: � t � | � � d uS �N)�_normalized_regexr# )r s r �is_normalized_namer, 3 s � ��"�"�4�(�(��4�4r T)�strip_trailing_zero�versionr- c �� � t | t � � r# t | � � }n# t $ r | cY S w xY w| }g }|j dk r|� |j � d�� � d� d� |j D � � � � }|rt j dd|� � }|� |� � |j �7|� d� d� |j D � � � � � � |j �|� d |j � �� � |j �|� d |j � �� � |j �|� 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 3 �4 K � | ]}t |� � V � �d S r* ��str��.0�xs r � <genexpr>z'canonicalize_version.<locals>.<genexpr>N s( � � � �>�>�!�s�1�v�v�>�>�>�>�>�>r z(\.0)+$� Nc 3 �4 K � | ]}t |� � V � �d S r* r3 r5 s r r8 z'canonicalize_version.<locals>.<genexpr>V s( � � � �8�8��S��V�V�8�8�8�8�8�8r z.postz.dev�+)� isinstancer4 r r �epoch�append�join�release�rer% �pre�post�dev�local)r. r- �parsed�parts�release_segments r �canonicalize_versionrI 7 s� � � �'�3��� � ��W�%�%�F�F��� � � ��N�N�N� ���� ���E� �|�q��� �����'�'�'�(�(�(� �h�h�>�>�v�~�>�>�>�>�>�O�� B��&��R��A�A�� �L�L��!�!�!� �z�� ���R�W�W�8�8�V�Z�8�8�8�8�8�9�9�9� �{�� ���*�V�[�*�*�+�+�+� �z�� ���(�F�J�(�(�)�)�)� �|�� ���'���'�'�(�(�(� �7�7�5�>�>�s �'