o
    b'                     @  sN   d dl mZ d dlmZ d dlmZ d dlmZ G dd deZdddZdS )    )annotations)	getLogger)InvalidVersion)Versionc                      s6   e Zd ZdZd fddZddd	Zdd
dZ  ZS )NonNormalizedVersiona2  A non-normalizing version handler.

    You can use this class to preserve version verification but skip normalization.
    For example you can use this to avoid git release candidate version tags
    ("1.0.0-rc1") to be normalized to "1.0.0rc1". Only use this if you fully
    trust the version tags.
    versionstrreturnNonec                   s   t  | || _d S N)super__init___raw_version)selfr   	__class__ ?usr/lib/python3.10/site-packages/setuptools_scm/_version_cls.pyr      s   
zNonNormalizedVersion.__init__c                 C  s   | j S r   r   r   r   r   r   __str__   s   zNonNormalizedVersion.__str__c                 C  s   d| j dS )Nz<NonNormalizedVersion(z)>r   r   r   r   r   __repr__   s   zNonNormalizedVersion.__repr__)r   r   r	   r
   )r	   r   )__name__
__module____qualname____doc__r   r   r   __classcell__r   r   r   r   r   	   s
    
r   version_strr   r	   tuple[int | str, ...]c                 C  sv   zt | }W n ty   td}|d|  | f Y S w |j}|jd ur.|d|j f7 }|jd ur9||jf7 }|S )Nsetuptools_scmzfailed to parse version %sdev)r   r   r   	exceptionreleaser    local)r   parsed_versionlogversion_fieldsr   r   r   _version_as_tuple"   s   


r'   N)r   r   r	   r   )	
__future__r   loggingr   packaging.versionr   r   r   r'   r   r   r   r   <module>   s    