
    h                    V    U d Z ddlmZ ddlZddlmZ d	dZ ee      Zde	d<   d
ddZ
y)a  Versioning utilities for the Mailjet REST API client.

This module defines the current version of the Mailjet client and provides
a helper function, `get_version`, to retrieve the version as a formatted string.

Attributes:
    VERSION (tuple[int, int, int]): A tuple representing the major, minor, and patch
    version of the package.

Functions:
    get_version: Returns the version as a string in the format "major.minor.patch".
    )annotationsN)__version__tuple[int, ...]c                    | syt        j                  d|       }|r9|j                  d      }t        t	        t
        |j                  d                  S y)zClean package version string into 3 item tuple.

    Parameters:
    version_str (str): A string of the package version.

    Returns:
    tuple: A tuple representing the version of the package.
    )r   r   r   z^(\d+\.\d+\.\d+)   .)rematchgrouptuplemapintsplit)version_strr
   version_parts      k/home/www/lekema-backend.kofcorporation.com/venv/lib/python3.12/site-packages/mailjet_rest/utils/version.pyclean_versionr      sK     HH(+6E{{1~Sl005677    VERSIONc                t    | t         } t        |       dk7  rd}t        |       dj                  d | D         S )a  Calculate package version based on a 3 item tuple.

    In addition, verify that the tuple contains 3 items.

    Parameters:
    version (tuple[int, ...], optional): A tuple representing the version of the package.
        If not provided, the function will use the VERSION constant.
        Default is None.

    Returns:
    str: The version as a string in the format "major.minor.patch".

    Raises:
    ValueError: If the provided tuple does not contain exactly 3 items.
       z(The tuple 'version' must contain 3 itemsz{}.{}.{}c              3      K   | ]  }|  y wN ).0xs     r   	<genexpr>zget_version.<locals>.<genexpr>B   s     2Qq2s   )r   len
ValueErrorformat)versionmsgs     r   get_versionr#   -   sB      
7|q8o:2'233r   )r   strreturnr   r   )r!   ztuple[int, ...] | Noner%   r$   )__doc__
__future__r   r	   mailjet_rest._versionr   package_versionr   r   __annotations__r#   r   r   r   <module>r+      s0    # 	 @* )9 94r   