관리-도구
편집 파일: utils.cpython-36.pyc
3 �Re � @ sx d dl mZmZmZ d dlZddlmZmZ ddlm Z m Z erZd dlmZm Z ede�Zejd�Zd d � Zdd� ZdS ) � )�absolute_import�division�print_functionN� )� TYPE_CHECKING�cast)�InvalidVersion�Version)�NewType�Union�NormalizedNamez[-_.]+c C s t jd| �j� }td|�S )N�-r )�_canonicalize_regex�sub�lowerr )�name�value� r ��/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/packaging/utils.py�canonicalize_name s r c C s� yt | �}W n tk r | S X g }|jdkrB|jdj|j�� |jtjdddjdd� |jD ���� |j dk r�|jdjd d� |j D ��� |j dk r�|jd j|j �� |jdk r�|jdj|j�� |jdk r�|jdj|j�� dj|�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 )N)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"