관리-도구
편집 파일: utils.cpython-38.pyc
U �Re � @ sx d dl mZmZmZ d dlZddlmZmZ ddlm Z m Z erZd dlmZm Z ede�Ze�d�Zd d � Zdd� ZdS ) � )�absolute_import�division�print_functionN� )� TYPE_CHECKING�cast)�InvalidVersion�Version)�NewType�Union�NormalizedNamez[-_.]+c C s t �d| ��� }td|�S )N�-r )�_canonicalize_regex�sub�lowerr )�name�value� r ��/builddir/build/BUILDROOT/alt-python38-setuptools-58.3.0-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/utils.py�canonicalize_name s r c C s� zt | �}W n tk r$ | Y S X g }|jdkrF|�d�|j�� |�t�ddd�dd� |jD ���� |j dk r�|�d�d d� |j D ��� |j dk r�|�d �|j �� |jdk r�|�d�|j�� |jdk 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 z{0}!z(\.0)+$� �.c s s | ]}t |�V qd S �N��str��.0�xr r r � <genexpr>/ s z'canonicalize_version.<locals>.<genexpr>Nc s s | ]}t |�V qd S r r r r r r r 3 s z.post{0}z.dev{0}z+{0}) r r �epoch�append�format�rer �join�release�pre�post�dev�local)�_version�version�partsr r r �canonicalize_version s"