o
    yAf)                     @   s,   d dl mZ d dlmZ G dd deZdS )    )VersionFile)VersionSourceInterfacec                   @   s4   e Zd ZdZdefddZdededdfdd	ZdS )
RegexSourceregexreturnc                 C   sz   | j dd}|sd}t|t|tsd}t|| j dd}t|ts,d}t|t| j|}|j|d}||dS )	Npath zoption `path` must be specifiedzoption `path` must be a stringpatternz!option `pattern` must be a string)r	   )versionversion_file)	configget
ValueError
isinstancestr	TypeErrorr   rootread)selfZrelative_pathmessager	   r   r
    r   C/usr/lib/python3.10/site-packages/hatchling/version/source/regex.pyget_version_data   s   


zRegexSource.get_version_datar
   version_dataNc                 C   s   |d  | d S )Nr   )set_version)r   r
   r   r   r   r   r      s   zRegexSource.set_version)__name__
__module____qualname__ZPLUGIN_NAMEdictr   r   r   r   r   r   r   r      s    r   N)Zhatchling.version.corer   Z)hatchling.version.source.plugin.interfacer   r   r   r   r   r   <module>   s    