o
    í6Wj‘  ã                   @  sh   d Z ddlmZ ddlZddlmZ dZdZ		 dZ
dd
d„Zddd„Zddd„Zddd„Zddd„ZdS )z@The `version` module holds the version information for Pydantic.é    )ÚannotationsN)Ú__version__)ÚVERSIONÚversion_infoz2.13.4z2.46.4ÚreturnÚstrc                   C  s   d  t d¡dd… ¡S )zmReturn the `major.minor` part of Pydantic version.

    It returns '2.1' if Pydantic version is '2.1.1'.
    Ú.Né   )Újoinr   Úsplit© r   r   ú_/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/pydantic/version.pyÚversion_short   s   r   c                  C  sð   ddl } ddl}ddlm} ddlm} ddlm} h d£}g }| j 	¡ D ]}|jd }||v r;| 
|› d|j› �¡ q%|tƒjd  ¡ }	| |	¡rS| ¡ rS| |	¡nd	}
ttt|d
dƒp_|jtj| ¡ d |¡|
dœ}d dd„ | ¡ D ƒ¡S )zFReturn complete version information for Pydantic and its dependencies.r   N)ÚPathé   )Ú_git>   úemail-validatorúpydantic-settingsúpydantic-extra-typesÚmypyÚfastapiÚpyrightÚtyping_extensionsÚNameú-ÚunknownÚ
build_infoú )zpydantic versionzpydantic-core versionzpydantic-core buildzpython versionÚplatformzrelated packagesÚcommitÚ
c                 s  s0   � | ]\}}d   |d t|ƒ dd¡¡V  qdS )z	{:>30} {}ú:r    r   N)Úformatr   Úreplace)Ú.0ÚkÚvr   r   r   Ú	<genexpr>J   s   €. zversion_info.<locals>.<genexpr>)Úimportlib.metadatar   Úpathlibr   Úpydantic_core._pydantic_coreÚ_pydantic_coreÚ	_internalr   ÚmetadataÚdistributionsÚappendÚversionÚ__file__ÚparentsÚresolveÚis_git_repoÚhave_gitÚgit_revisionr   Ú__pydantic_core_version__ÚgetattrÚbuild_profileÚsysr
   Úitems)Ú	importlibr   r   ÚpdcÚgitÚpackage_namesÚrelated_packagesÚdistÚnameÚpydantic_dirÚmost_recent_commitÚinfor   r   r   r   !   s0   	
€ÿù	r   Úboolc                   C  s   t tkS )zBCheck that the installed `pydantic-core` dependency is compatible.)r7   Ú!_COMPATIBLE_PYDANTIC_CORE_VERSIONr   r   r   r   Úcheck_pydantic_core_versionM   s   rH   ÚNonec                  C  sd   t ƒ s.d} tjdkr!ddlm} |dƒ}tt|jdd ƒddƒr!d} | r0td	t› d
t	› d�ƒ‚d S d S )NT)é   é   r   )ÚdistributionÚpydanticÚdir_infoÚeditableFz%The installed pydantic-core version (zD) is incompatible with the current pydantic version, which requires zZ. If you encounter this error, make sure that you haven't upgraded pydantic-core manually.)
rH   r:   r   r(   rL   r8   ÚoriginÚSystemErrorr7   rG   )Úraise_errorrL   rA   r   r   r   Ú_ensure_pydantic_core_versionR   s   
ÿÿõ
rS   r0   útuple[int, int, int]c                 C  s   t tt|  d¡d  d¡ƒƒS )a>  Parse `mypy` string version to a 3-tuple of ints.

    It parses normal version like `1.11.0` and extra info followed by a `+` sign
    like `1.11.0+dev.d6d9d8cd4f27c52edac1f537e236ec48a01e54cb.dirty`.

    Args:
        version: The mypy version string.

    Returns:
        A triple of ints, e.g. `(1, 11, 0)`.
    ú+r   r   )ÚtupleÚmapÚintÚ	partitionr   )r0   r   r   r   Úparse_mypy_versione   s   rZ   )r   r   )r   rF   )r   rI   )r0   r   r   rT   )Ú__doc__Ú
__future__r   Ú_annotationsr:   Úpydantic_corer   r7   Ú__all__r   rG   r   r   rH   rS   rZ   r   r   r   r   Ú<module>   s    



,
