o
    Zh                     @  sR   d Z ddlmZ ddlmZ dZ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.    )annotations)__version__)VERSIONversion_infoz2.11.1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   G/var/www/html/lang_env/lib/python3.10/site-packages/pydantic/version.pyversion_short   s   r   c               	   C  s  ddl m}  ddl}ddl}ddl}ddlm} ddlm} ddl	m
} h d}g }|  D ]}	|	jd }
|
|v rD||
 d|	j  q.|j|j|jt}||ra| ra||nd	}t|jt|d
dpn|j|t j|j| d||d}ddd | D S )zFReturn complete version information for Pydantic and its dependencies.r   N)Path   )_git>   ZmypyZfastapizpydantic-settingstyping_extensionszpydantic-extra-typesZpyrightzemail-validatorName-unknownZ
build_info )zpydantic versionzpydantic-core versionzpydantic-core buildzinstall pathz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>A   s   . zversion_info.<locals>.<genexpr>)importlib.metadatametadataosr   syspathlibr   Zpydantic_core._pydantic_coreZ_pydantic_core	_internalr   distributionsappendversionpathabspathdirname__file__Zis_git_repoZhave_gitZgit_revisionr   r   getattrZbuild_profileresolveparentr
   items)importlib_metadatar#   r   r$   r   ZpdcgitZpackage_namesZrelated_packagesdistnameZpydantic_dirZmost_recent_commitinfor   r   r   r      s6   	

r   boolc                   C  s   t dkS )zBCheck that the installed `pydantic-core` dependency is compatible.z2.33.0)__pydantic_core_version__r   r   r   r   check_pydantic_core_versionD   s   r9   r)   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   )r)   r   r   r   parse_mypy_versionJ   s   r@   N)r   r   )r   r7   )r)   r   r   r:   )__doc__
__future__r   Z_annotationsZpydantic_corer   r8   __all__r   r   r   r9   r@   r   r   r   r   <module>   s    


/