o
�J�h , � @ sF d Z ddlZddlZddlmZmZ ddlmZ ddlm Z m
Z
mZmZ ddl
mZ ddlmZ dd lmZmZ dDddded
�dee dee d
ee dee de e defdd�Zedded�dededefdd��Zedd�dd� �Zeddd�d d!� �Zedd�d"d#� �Zed$d%d�d&d'� �Zed(d%d�d)d*� �Zed+dd�dEd,d-��Z edd�d.d/� �Z!edd�d0d1� �Z"edd�d2d3� �Z#edd�dFd5d6��Z$edd�dGd8d9��Z%edd�d:d;� �Z&edd�d<d� �Z'eej(d=dd�Z(eej)d>dd�Z)eej*d?dd�Z*eej+d@dd�Z+eej,dAdd�Z,eej-dBdd�Z-eej.dCdd�Z.dS )HzA
Contains all deprecated functions.
.. autofunction: deprecated
� N)�partial�wraps)� FrameType)�Type�Callable�Optional�cast� )�cli)�Version)� Decorator�F��replace�version�remove�category�funcr r r r �returnc sH �du r
t t���� d�S t��dtdtf f� ����fdd��}|S )aN
Decorates a function to output a deprecation warning.
:param func: the function to decorate
:param replace: the function to replace (use the full qualified
name like ``semver.version.Version.bump_major``.
:param version: the first version when this function was deprecated.
:param category: allow you to specify the deprecation warning class
of your choice. By default, it's :class:`DeprecationWarning`, but
you can choose :class:`PendingDeprecationWarning` or a custom class.
:return: decorated function which is marked as deprecated
Nr r .c s� dg}�r
|� d� �s|� d� n|� t��� �r!|� d� n|� d� tt��j}�p/|}ttttt�� �j�}d� |�}t
j|j||�d�� t�
|j�|jd� ~�| i |��S ) Nz$Function 'semver.{f}' is deprecated.zDeprecated since version {v}. z*This function will be removed in semver 3.zUse {r!r} instead.z0Use the respective 'semver.Version.{r}' instead.� )�f�r�v)r �filename�lineno)�append�strr r
�__qualname__r �inspect�currentframe�f_back�join�warnings�
warn_explicit�format�getfile�f_code�f_lineno)�args�kwargsZmsg_listr r �frame�msg�r r r r r � �PC:\pinokio\api\whisper-webui.git\app\env\lib\site-packages\semver\_deprecated.py�wrapper0 s*
� zdeprecated.<locals>.wrapper)r �
deprecatedr r r
)r r r r r r/ r- r, r. r0 s �$"r0 z3.0.0z$Still under investigation, see #258.)r r r �ver1�ver2c C s t �| ��|�S )a`
Compare two versions strings.
.. deprecated:: 3.0.0
The situation of this function is unclear and it might
disappear in the future.
If possible, use :meth:`semver.version.Version.compare`.
See :gh:`258` for details.
:param ver1: first version string
:param ver2: second version string
:return: The return value is negative if ver1 < ver2,
zero if ver1 == ver2 and strictly positive if ver1 > ver2
>>> semver.compare("1.0.0", "2.0.0")
-1
>>> semver.compare("2.0.0", "1.0.0")
1
>>> semver.compare("2.0.0", "2.0.0")
0
)r �parse�compare�r1 r2 r- r- r. r4 V s r4 z2.10.0�r c C s t �| ��� S )aP
Parse version to major, minor, patch, pre-release, build parts.
.. deprecated:: 2.10.0
Use :meth:`~semver.version.Version.parse` instead.
:param version: version string
:return: dictionary with the keys 'build', 'major', 'minor', 'patch',
and 'prerelease'. The prerelease or build keys can be None
if not provided
:rtype: dict
>>> ver = semver.parse('3.4.5-pre.2+build.4')
>>> ver['major']
3
>>> ver['minor']
4
>>> ver['patch']
5
>>> ver['prerelease']
'pre.2'
>>> ver['build']
'build.4'
)r r3 �to_dictr6 r- r- r. r3 t s r3 zsemver.version.Version.parse)r r c C s
t �| �S )a#
Parse version string to a Version instance.
.. deprecated:: 2.10.0
Use :meth:`~semver.version.Version.parse` instead.
.. versionadded:: 2.7.2
Added :func:`semver.parse_version_info`
:param version: version string
:return: a :class:`VersionInfo` instance
>>> version_info = semver.Version.parse("3.4.5-pre.2+build.4")
>>> version_info.major
3
>>> version_info.minor
4
>>> version_info.patch
5
>>> version_info.prerelease
'pre.2'
>>> version_info.build
'build.4'
)r r3 r6 r- r- r. �parse_version_info� s
r8 c C s t �| �}|�|�S )aj
Compare two versions strings through a comparison.
.. deprecated:: 2.10.0
Use :meth:`~semver.version.Version.match` instead.
:param str version: a version string
:param str match_expr: operator and version; valid operators are
< smaller than
> greater than
>= greator or equal than
<= smaller or equal than
== equal
!= not equal
:return: True if the expression matches the version, otherwise False
:rtype: bool
>>> semver.match("2.0.0", ">=1.0.0")
True
>>> semver.match("1.0.0", ">1.0.0")
False
)r r3 �match)r �
match_expr�verr- r- r. r9 � s
r9 �maxz2.10.2c C � t t| |tjd��S )a>
Returns the greater version of two versions strings.
.. deprecated:: 2.10.2
Use :func:`max` instead.
:param ver1: version string 1
:param ver2: version string 2
:return: the greater version of the two
:rtype: :class:`Version`
>>> semver.max_ver("1.0.0", "2.0.0")
'2.0.0'
��key)r r<