o
    yAf                     @  sj   d dl mZ d dlmZ 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edddZdS )    )annotations)Any)MetadataHookInterface)hookimpl   )
build_text)load_and_validate_configc                   @  s   e Zd ZdZd	ddZdS )
FancyReadmeMetadataHookzfancy-pypi-readmemetadatadict[str, Any]returnNonec                 C  s4   t | j}|jt|j|j|dddd|d< dS )z6
        Update the project table's metadata.
        version )r   )zcontent-typetextZreadmeN)r   configcontent_typer   	fragmentsZsubstitutionsget)selfr
   r    r   B/usr/lib/python3.10/site-packages/hatch_fancy_pypi_readme/hooks.pyupdate   s   

zFancyReadmeMetadataHook.updateN)r
   r   r   r   )__name__
__module____qualname__ZPLUGIN_NAMEr   r   r   r   r   r	      s    r	   r   type[MetadataHookInterface]c                   C  s   t S )N)r	   r   r   r   r   hatch_register_metadata_hook#   s   r   N)r   r   )
__future__r   typingr   Z#hatchling.metadata.plugin.interfacer   Zhatchling.pluginr   Z_builderr   _configr   r	   r   r   r   r   r   <module>   s   