o
    èyAf<  ã                   @  s0   d dl mZ d dlmZmZ G dd„ deƒZdS )é    )Úannotations)ÚABCÚabstractmethodc                   @  sT   e Zd ZdZdZ	 dd	d
„Zeddd„ƒZeddd„ƒZe	ddd„ƒZ
ddd„ZdS )ÚVersionSourceInterfaceaÑ  
    Example usage:

    ```python tab="plugin.py"
    from hatchling.version.source.plugin.interface import VersionSourceInterface


    class SpecialVersionSource(VersionSourceInterface):
        PLUGIN_NAME = 'special'
        ...
    ```

    ```python tab="hooks.py"
    from hatchling.plugin import hookimpl

    from .plugin import SpecialVersionSource


    @hookimpl
    def hatch_register_version_source():
        return SpecialVersionSource
    ```
    Ú ÚrootÚstrÚconfigÚdictÚreturnÚNonec                 C  s   || _ || _d S )N)Ú_VersionSourceInterface__rootÚ_VersionSourceInterface__config)Úselfr   r	   © r   úN/usr/lib/python3.10/site-packages/hatchling/version/source/plugin/interface.pyÚ__init__"   s   
zVersionSourceInterface.__init__c                 C  ó   | j S )z;
        The root of the project tree as a string.
        )r   ©r   r   r   r   r   &   s   zVersionSourceInterface.rootc                 C  r   )zQ
        ```toml config-example
        [tool.hatch.version]
        ```
        )r   r   r   r   r   r	   -   s   zVersionSourceInterface.configc                 C  s   dS )aÍ  
        This should return a mapping with a `version` key representing the current version of the project and will be
        displayed when invoking the [`version`](../../cli/reference.md#hatch-version) command without any arguments.

        The mapping can contain anything else and will be passed to
        [set_version](reference.md#hatchling.version.source.plugin.interface.VersionSourceInterface.set_version)
        when updating the version.
        Nr   r   r   r   r   Úget_version_data6   s    z'VersionSourceInterface.get_version_dataÚversionÚversion_datac                 C  s   t ‚)zo
        This should update the version to the first argument with the data provided during retrieval.
        )ÚNotImplementedError)r   r   r   r   r   r   Úset_versionA   s   z"VersionSourceInterface.set_versionN)r   r   r	   r
   r   r   )r   r   )r   r
   )r   r   r   r
   r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__ZPLUGIN_NAMEr   Úpropertyr   r	   r   r   r   r   r   r   r   r      s    

r   N)Ú
__future__r   Úabcr   r   r   r   r   r   r   Ú<module>   s    