AlkantarClanX12
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/packaging/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/packaging/__pycache__/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 e j d� � Z e j d � � Zdedefd�Zdd�deeef dedefd�Zdedeeeeee f fd�Zdedeeef fd�ZdS )� N)� FrozenSet�NewType�Tuple�Union�cast� )�Tag� parse_tag)�InvalidVersion�Version� �NormalizedNamec � � e Zd ZdZdS )�InvalidWheelFilenamezM An invalid wheel filename was found, users should refer to PEP 427. N��__name__� __module__�__qualname__�__doc__r � �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/packaging/utils.pyr 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[-_.]+z (\d+)(.*)�name�returnc � � t � d| � � � � � }t t |� � S )N�-)�_canonicalize_regex�sub�lowerr r )r �values r �canonicalize_namer# s3 � ��#�#�C��.�.�4�4�6�6�E����&�&�&r 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 �N��str��.0�xs r � <genexpr>z'canonicalize_version.<locals>.<genexpr>= s( � � � �>�>�!�s�1�v�v�>�>�>�>�>�>r z(\.0)+$� Nc 3 �4 K � | ]}t |� � V � �d S r* r+ r- s r r0 z'canonicalize_version.<locals>.<genexpr>E s( � � � �8�8��S��V�V�8�8�8�8�8�8r z.postz.dev�+)� isinstancer, r r �epoch�append�join�release�rer �pre�post�dev�local)r% r$ �parsed�parts�release_segments r �canonicalize_versionrA &