
    b                     .   S r SSKJr  SSKrSSKrSSKJrJr  SSKrSSK	r	SSK
r
SSKr\
R                  S   S:H  r\
R                  S   S:H  rSrSrS	rS
S/rSrSrSr\" \S5      (       d  S r\(       a  \\4r\r\rS rS rO\ \4r\ r\rS rS rS9S jr!SSS\"4S jr#\#" SS9S 5       r$S r% " S S\&5      r'\#" SSS9S 5       r(S  r)\#" SS9S! 5       r*\#" SS9S" 5       r+\#" S#S$S9S% 5       r,\#" S&S$S9S' 5       r-\#" S(SS9S:S) j5       r.\#" SS9S* 5       r/\#" SS9S+ 5       r0\#" SS9S, 5       r1\#" SS9S;S- j5       r2\#" SS9S<S. j5       r3\#" SS9S/ 5       r4\#" SS9S0 5       r5S1 r6S2 r7S3 r8S4 r9S5 r:S6 r;S=S7 jr<\=S8:X  a  SSK>r>\>R~                  " 5         gg)>z:Python helper for Semantic Versioning (http://semver.org/)    )print_functionN)wrapspartial      z2.13.0zKostiantyn Rybnikovzk-bx@k-bx.comzSebastien CelleszTom Schraitlezs.celles@gmail.com)
bump_build
bump_major
bump_minor
bump_patchbump_prereleasecompare
deprecatedfinalize_versionformat_versionmatchmax_vermin_verparseparse_version_inforeplacecmd_bump	cmd_checkcmd_comparecreateparsermainprocessSEMVER_SPEC_VERSIONVersionInfoz2.0.0cmpc                     X:  X:  -
  $ )z6Return negative if a<b, zero if a==b, positive if a>b. abs     aZ:\mnt\Skyabridged\SteamLibrary\steamapps\common\Borderlands 2\sdk_mods\EridiumLib\dist\semver.pyr   r   >   s    !%      c                 $    U R                  S5      $ )Nzlatin-1)encodess    r%   r$   r$   H   s    xx	""r&   c                     U $ Nr!   r)   s    r%   ur-   K       r&   c                     U $ r,   r!   r)   s    r%   r$   r$   T   r.   r&   c                 :    [        U R                  SS5      S5      $ )Nz\\z\\\\unicode_escape)unicoder   r)   s    r%   r-   r-   X   s    qyy02BCCr&   c                 2   [        U [        [        45      (       d  [        S[	        U 5      -  5      e[
        (       a(  [        U [        5      (       a  U R                  X5      n U $ [        (       a&  [        U [        5      (       a  U R                  X5      n U $ )z
Coerce *s* to `str`.

For Python 2:
  - `unicode` -> encoded to `str`
  - `str` -> `str`

For Python 3:
  - `str` -> `str`
  - `bytes` -> decoded to `str`
znot expecting type '%s')	
isinstance	text_typebinary_type	TypeErrortypePY2r(   PY3decode)r*   encodingerrorss      r%   
ensure_strr>   \   sw     a)[1221DG;<<
sz!Y''HHX& H 
A{++HHX&Hr&   c                 b   ^ ^^^ T c  [        [        TTTS9$ [        T 5      UU UU4S j5       nU$ )a  
Decorates a function to output a deprecation warning.

:param func: the function to decorate (or None)
:param str replace: the function to replace (use the full qualified
    name like ``semver.VersionInfo.bump_major``.
:param str 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.
)r   versioncategoryc            	      :  > S/nT	(       a  UR                  S5        UR                  S5        T(       a  UR                  S5        OUR                  S5        [        TS5      (       a  TR                  OTR                  nT=(       d    Un[        R
                  " 5       R                  nSR                  U5      n[        R                  " UR                  TR                  X4T	S9T[        R                  " UR                  5      UR                  S	9  AT" U 0 UD6$ )
Nz!Function '{m}.{f}' is deprecated.zDeprecated since version {v}. z*This function will be removed in semver 3.zUse {r!r} instead.z4Use the respective 'semver.VersionInfo.{r}' instead.__qualname__ )mfrv)rA   filenamelineno)appendhasattrrC   __name__inspectcurrentframef_backjoinwarningswarn_explicitformat
__module__getfilef_codef_lineno)
argskwargsmsgrF   rG   framerA   funcr   r@   s
         r%   wrapperdeprecated.<locals>.wrapper   s    23JJ78

?@JJ+,JJMN ")~!>!>DDMMLq$$&--hhsmJJAgJ>__U\\2>>		
 T$V$$r&   )r   r   r   )r]   r   r@   rA   r^   s   ```` r%   r   r   r   s8     |z7GhWW
4[% %< Nr&   2.10.0r@   c                 H    [         R                  U 5      R                  5       $ )a  
Parse version to major, minor, patch, pre-release, build parts.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.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   r   to_dictra   s    r%   r   r      s    4 W%--//r&   c                 0   ^  [        T 5      U 4S j5       nU$ )z4Wrap a VersionInfo binary op method in a type-check.c                    > [         [        [        [        [        [
        4n[        X5      (       d  [        S[        U5      < SU< 35      eT" X5      $ )Nzother type z must be in )	r   dicttuplelistr5   r6   r4   r7   r8   )selfothercomparable_typesoperators      r%   r^   comparator.<locals>.wrapper   sH    'udI{S%2215e>NO  $$r&   )r   )rl   r^   s   ` r%   
comparatorrn      s"     8_% % Nr&   c                      \ rS rSrSrSr\R                  " S5      r\R                  " S\R                  5      r
S3S jr\S 5       r\R                  S	 5       r\S
 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       r\S 5       r\R                  S 5       rS rS r\" SSS9S 5       r\R                  \l        \" SSS9S 5       r\R                  \l        S r\S 5       rS rS rS rS4S jrS5S  jrS! r S4S" jr!\"S# 5       r#\"S$ 5       r$\"S% 5       r%\"S& 5       r&\"S' 5       r'\"S( 5       r(S) r)S* r*S+ r+S, r,S- r-S. r.\/S/ 5       r0S0 r1\/S1 5       r2S2r3g)6r      ax  
A semver compatible version class.

:param int major: version when you make incompatible API changes.
:param int minor: version when you add functionality in
                  a backwards-compatible manner.
:param int patch: version when you make backwards-compatible bug fixes.
:param str prerelease: an optional prerelease string
:param str build: an optional build string
)_major_minor_patch_prerelease_buildz(?:[^\d]*(\d+)[^\d]*)+a  
            ^
            (?P<major>0|[1-9]\d*)
            \.
            (?P<minor>0|[1-9]\d*)
            \.
            (?P<patch>0|[1-9]\d*)
            (?:-(?P<prerelease>
                (?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)
                (?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*
            ))?
            (?:\+(?P<build>
                [0-9a-zA-Z-]+
                (?:\.[0-9a-zA-Z-]+)*
            ))?
            $
        Nc                 <   UUUS.nUR                  5        H4  u  px[        U5      nXU'   US:  d  M  [        SR                  U5      5      e   US   U l        US   U l        US   U l        Uc  S O
[        U5      U l        Uc  S U l	        g [        U5      U l	        g )Nmajorminorpatchr   z1{!r} is negative. A version can only be positive.rx   ry   rz   )
itemsint
ValueErrorrT   rq   rr   rs   strrt   ru   )	ri   rx   ry   rz   
prereleasebuildversion_partsnamevalues	            r%   __init__VersionInfo.__init__   s     
 )..0KDJE"'$qy GNNtT 	 1 $G,#G,#G,#-#543z?#mdUr&   c                     U R                   $ )z(The major part of a version (read-only).)rq   ri   s    r%   rx   VersionInfo.major       {{r&   c                     [        S5      e)Nzattribute 'major' is readonlyAttributeErrorri   r   s     r%   rx   r         <==r&   c                     U R                   $ )z(The minor part of a version (read-only).)rr   r   s    r%   ry   VersionInfo.minor  r   r&   c                     [        S5      e)Nzattribute 'minor' is readonlyr   r   s     r%   ry   r     r   r&   c                     U R                   $ )z(The patch part of a version (read-only).)rs   r   s    r%   rz   VersionInfo.patch  r   r&   c                     [        S5      e)Nzattribute 'patch' is readonlyr   r   s     r%   rz   r   "  r   r&   c                     U R                   $ )z-The prerelease part of a version (read-only).)rt   r   s    r%   r   VersionInfo.prerelease&  s     r&   c                     [        S5      e)Nz"attribute 'prerelease' is readonlyr   r   s     r%   r   r   +  s    ABBr&   c                     U R                   $ )z(The build part of a version (read-only).)ru   r   s    r%   r   VersionInfo.build/  r   r&   c                     [        S5      e)Nzattribute 'build' is readonlyr   r   s     r%   r   r   4  r   r&   c                 t    U R                   U R                  U R                  U R                  U R                  4$ )a1  
Convert the VersionInfo object to a tuple.

.. versionadded:: 2.10.0
   Renamed ``VersionInfo._astuple`` to ``VersionInfo.to_tuple`` to
   make this function available in the public API.

:return: a tuple with all the parts
:rtype: tuple

>>> semver.VersionInfo(5, 3, 1).to_tuple()
(5, 3, 1, None, None)
rx   ry   rz   r   r   r   s    r%   to_tupleVersionInfo.to_tuple8  s)     

DJJ

DOOTZZPPr&   c                     [         R                  " SU R                  4SU R                  4SU R                  4SU R
                  4SU R                  445      $ )a  
Convert the VersionInfo object to an OrderedDict.

.. versionadded:: 2.10.0
   Renamed ``VersionInfo._asdict`` to ``VersionInfo.to_dict`` to
   make this function available in the public API.

:return: an OrderedDict with the keys in the order ``major``, ``minor``,
  ``patch``, ``prerelease``, and ``build``.
:rtype: :class:`collections.OrderedDict`

>>> semver.VersionInfo(3, 2, 1).to_dict()
OrderedDict([('major', 3), ('minor', 2), ('patch', 1), ('prerelease', None), ('build', None)])
rx   ry   rz   r   r   )collectionsOrderedDictrx   ry   rz   r   r   r   s    r%   rc   VersionInfo.to_dictH  sX      &&$**%$**%$**%t/$**%
 	
r&   zsemver.VersionInfo.to_tupler`   r   r@   c                 "    U R                  5       $ r,   r   r   s    r%   _astupleVersionInfo._astuplec  s    }}r&   zsemver.VersionInfo.to_dictc                 "    U R                  5       $ r,   )rc   r   s    r%   _asdictVersionInfo._asdicti  s    ||~r&   c              #   B   #    U R                  5        H  nUv   M	     g7f)zImplement iter(self).Nr   )ri   rH   s     r%   __iter__VersionInfo.__iter__o  s      AG !s   c                 
   [         R                  R                  U 5      nU(       a\  [        [	        UR                  S5      5      S-   5      nUR                  S5      u  p4U S[        U[        U5      -
  U5       U-   XS -   n U $ )z
Look for the last sequence of number(s) in a string and increment.

:param str string: the string to search for.
:return: the incremented string

Source:
http://code.activestate.com/recipes/442460-increment-numbers-in-a-string/#c1
   N)	r   _LAST_NUMBERsearchr~   r|   groupspanmaxlen)stringr   next_startends        r%   _increment_stringVersionInfo._increment_stringu  sx     ((//7EKKN+a/0EAJE:c#E
"2E:;eCfTlRFr&   c                 B    [        U 5      nU" U R                  S-   5      $ )a'  
Raise the major part of the version, return a new object but leave self
untouched.

:return: new object with the raised major part
:rtype: :class:`VersionInfo`

>>> ver = semver.VersionInfo.parse("3.4.5")
>>> ver.bump_major()
VersionInfo(major=4, minor=0, patch=0, prerelease=None, build=None)
r   )r8   rq   ri   clss     r%   r	   VersionInfo.bump_major  s      4j4;;?##r&   c                 X    [        U 5      nU" U R                  U R                  S-   5      $ )a'  
Raise the minor part of the version, return a new object but leave self
untouched.

:return: new object with the raised minor part
:rtype: :class:`VersionInfo`

>>> ver = semver.VersionInfo.parse("3.4.5")
>>> ver.bump_minor()
VersionInfo(major=3, minor=5, patch=0, prerelease=None, build=None)
r   )r8   rq   rr   r   s     r%   r
   VersionInfo.bump_minor  s&     4j4;;a00r&   c                 n    [        U 5      nU" U R                  U R                  U R                  S-   5      $ )a'  
Raise the patch part of the version, return a new object but leave self
untouched.

:return: new object with the raised patch part
:rtype: :class:`VersionInfo`

>>> ver = semver.VersionInfo.parse("3.4.5")
>>> ver.bump_patch()
VersionInfo(major=3, minor=4, patch=6, prerelease=None, build=None)
r   )r8   rq   rr   rs   r   s     r%   r   VersionInfo.bump_patch  s,     4j4;;T[[1_==r&   c                     [        U 5      nUR                  U R                  =(       d    U=(       d    SS-   5      nU" U R                  U R                  U R
                  U5      $ )a\  
Raise the prerelease part of the version, return a new object but leave
self untouched.

:param token: defaults to 'rc'
:return: new object with the raised prerelease part
:rtype: :class:`VersionInfo`

>>> ver = semver.VersionInfo.parse("3.4.5-rc.1")
>>> ver.bump_prerelease()
VersionInfo(major=3, minor=4, patch=5, prerelease='rc.2', build=None)
rc.0)r8   r   rt   rq   rr   rs   )ri   tokenr   r   s       r%   r   VersionInfo.bump_prerelease  sO     4j**4+;+;+UQU?UV
4;;T[[*EEr&   c                     [        U 5      nUR                  U R                  =(       d    U=(       d    SS-   5      nU" U R                  U R                  U R
                  U R                  U5      $ )a^  
Raise the build part of the version, return a new object but leave self
untouched.

:param token: defaults to 'build'
:return: new object with the raised build part
:rtype: :class:`VersionInfo`

>>> ver = semver.VersionInfo.parse("3.4.5-rc.1+build.9")
>>> ver.bump_build()
VersionInfo(major=3, minor=4, patch=5, prerelease='rc.1', build='build.10')
r   r   )r8   r   ru   rq   rr   rs   rt   )ri   r   r   r   s       r%   r   VersionInfo.bump_build  sU     4j%%dkk&Ne6Fw$5NO4;;T[[$:J:JERRr&   c                 L   [        U 5      n[        U[        5      (       a  UR                  U5      nO}[        U[        5      (       a	  U" S0 UD6nO_[        U[
        [        45      (       a  U" U6 nO>[        X5      (       d.  [        SR                  UR                  [        U5      5      5      eU R                  5       SS nUR                  5       SS n[        X45      nU(       a  U$ U R                  UR                  pv[        Xg5      nU(       d  gU(       d  gU(       d  gU$ )a  
Compare self with other.

:param other: the second version (can be string, a dict, tuple/list, or
     a VersionInfo instance)
:return: The return value is negative if ver1 < ver2,
     zero if ver1 == ver2 and strictly positive if ver1 > ver2
:rtype: int

>>> semver.VersionInfo.parse("1.0.0").compare("2.0.0")
-1
>>> semver.VersionInfo.parse("2.0.0").compare("1.0.0")
1
>>> semver.VersionInfo.parse("2.0.0").compare("2.0.0")
0
>>> semver.VersionInfo.parse("2.0.0").compare(dict(major=2, minor=0, patch=0))
0
z'Expected str or {} instance, but got {}Nr   r   r   r!   )r8   r4   string_typesr   rf   rg   rh   r7   rT   rM   r   r   r   _nat_cmp)	ri   rj   r   v1v2xrc1rc2rccmps	            r%   r   VersionInfo.compare  s    & 4je\**IIe$Et$$L%LEt}--KEE''9@@LL$u+  ]]_Ra ^^bq!KH??E$4$4S"r&   c                    1 SknX;  a  [        SR                  X1S95      eU nUR                  (       d  UR                  (       aV  US:X  d@  US:X  a  UR                  S:X  d*  US:X  a4  UR
                  UR                  s=:X  a  S:X  a  O  OUR                  SSS	9$ US
;   a  [        USU-   5      " 5       $ UR                  (       d  UR                  5       nUR                  U5      $ )a  
Determines next version, preserving natural order.

.. versionadded:: 2.10.0

This function is taking prereleases into account.
The "major", "minor", and "patch" raises the respective parts like
the ``bump_*`` functions. The real difference is using the
"preprelease" part. It gives you the next patch version of the prerelease,
for example:

>>> str(semver.VersionInfo.parse("0.1.4").next_version("prerelease"))
'0.1.5-rc.1'

:param part: One of "major", "minor", "patch", or "prerelease"
:param prerelease_token: prefix string of prerelease, defaults to 'rc'
:return: new object with the appropriate part raised
:rtype: :class:`VersionInfo`
>   rx   ry   rz   r   z<Invalid part. Expected one of {validparts}, but got {part!r})
validpartspartrz   ry   r   rx   N)r   r   rw   bump_)
r}   rT   r   r   rz   ry   r   getattrr   r   )ri   r   prerelease_tokenr   r@   s        r%   next_versionVersionInfo.next_version  s    (

 !NUU) V  
 '--GOGMMQ$6GMMW]]$Ga$G??d$???..7GdN355!!((*G&&'788r&   c                 *    U R                  U5      S:H  $ Nr   r   ri   rj   s     r%   __eq__VersionInfo.__eq__;      ||E"a''r&   c                 *    U R                  U5      S:g  $ r   r   r   s     r%   __ne__VersionInfo.__ne__?  r   r&   c                 *    U R                  U5      S:  $ r   r   r   s     r%   __lt__VersionInfo.__lt__C      ||E"Q&&r&   c                 *    U R                  U5      S:*  $ r   r   r   s     r%   __le__VersionInfo.__le__G  r   r&   c                 *    U R                  U5      S:  $ r   r   r   s     r%   __gt__VersionInfo.__gt__K  r   r&   c                 *    U R                  U5      S:  $ r   r   r   s     r%   __ge__VersionInfo.__ge__O  r   r&   c                    [        U[        5      (       a  [        XS-   5      n[        U[        5      (       a  UR                  b  UR                  S:  d  UR                  b  UR                  S:  a  [        S5      e[        [        S U R                  5       U   5      5      n[        U5      S:X  a  US   nU$ U(       d  [        S5      eU$ )a  
self.__getitem__(index) <==> self[index]

Implement getitem. If the part requested is undefined, or a part of the
range requested is undefined, it will throw an index error.
Negative indices are not supported

:param Union[int, slice] index: a positive integer indicating the
       offset or a :func:`slice` object
:raises: IndexError, if index is beyond the range or a part is None
:return: the requested part of the version at position index

>>> ver = semver.VersionInfo.parse("3.4.5")
>>> ver[0], ver[1], ver[2]
(3, 4, 5)
r   r   z Version index cannot be negativec                 
    U S L$ r,   r!   )ps    r%   <lambda>)VersionInfo.__getitem__.<locals>.<lambda>n  s    atmr&   zVersion part undefined)
r4   r|   slicer   stop
IndexErrorrg   filterr   r   )ri   indexr   s      r%   __getitem__VersionInfo.__getitem__S  s    " eS!!%+E ue$$(U[[1_

&5::>?@@V3T]]_U5KLMt9>7D  566r&   c                     SR                  S U R                  5       R                  5        5       5      n[        U 5      R                  < SU< S3$ )N, c              3   8   #    U  H  u  pU< S U< 3v   M     g7f)=Nr!   ).0keyvals      r%   	<genexpr>'VersionInfo.__repr__.<locals>.<genexpr>w  s     R;Qxsc*;Qs   ())rQ   rc   r{   r8   rM   )ri   r*   s     r%   __repr__VersionInfo.__repr__v  s:    IIR4<<>;O;O;QRR:..22r&   c                     SU R                   U R                  U R                  4-  nU R                  (       a  USU R                  -  -  nU R                  (       a  USU R                  -  -  nU$ )z	str(self)z%d.%d.%dz-%sz+%sr   )ri   r@   s     r%   __str__VersionInfo.__str__z  sX    

DJJ

CC??ut..G::utzz))Gr&   c                 :    [        U R                  5       S S 5      $ )N   )hashr   r   s    r%   __hash__VersionInfo.__hash__  s    DMMOBQ'((r&   c                 h    [        U 5      nU" U R                  U R                  U R                  5      $ )z
Remove any prerelease and build metadata from the version.

:return: a new instance with the finalized version string
:rtype: :class:`VersionInfo`

>>> str(semver.VersionInfo.parse('1.2.3-rc.5').finalize_version())
'1.2.3'
)r8   rx   ry   rz   r   s     r%   r   VersionInfo.finalize_version  s(     4j4::tzz4::66r&   c                     USS nUS;   a  USS nO)U(       a  US   S;   a  US   nUSS nO[        SU-  5      eSS	S
SSSS.nXB   nU R                  U5      nXe;   $ )a  
Compare self to match a match expression.

: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.VersionInfo.parse("2.0.0").match(">=1.0.0")
True
>>> semver.VersionInfo.parse("1.0.0").match(">1.0.0")
False
Nr   )>=<===!=r   )><r   z}match_expr parameter should be in format <op><ver>, where <op> is one of ['<', '>', '==', '<=', '>=', '!=']. You provided: %r)r   )r   )r   )r   r   )r   r   )r   r   )r  r  r  r  r  r  )r}   r   )ri   
match_exprprefixmatch_versionpossibilities_dictpossibilitiescmp_ress          r%   r   VersionInfo.match  s    & BQ--&qrNMq	Z/AYF&qrNM# &00  
 +2,,}-''r&   c                    U R                   R                  [        U5      5      nUc  [        SU-  5      eUR	                  5       n[        US   5      US'   [        US   5      US'   [        US   5      US'   U " S0 UD6$ )a  
Parse version string to a VersionInfo instance.

:param version: version string
:return: a :class:`VersionInfo` instance
:raises: :class:`ValueError`
:rtype: :class:`VersionInfo`

.. versionchanged:: 2.11.0
   Changed method from static to classmethod to
   allow subclasses.

>>> semver.VersionInfo.parse('3.4.5-pre.2+build.4')
VersionInfo(major=3, minor=4, patch=5, prerelease='pre.2', build='build.4')
z%s is not valid SemVer stringrx   ry   rz   r!   )_REGEXr   r>   r}   	groupdictr|   )r   r@   r   r   s       r%   r   VersionInfo.parse  s    $ 

  G!45=<wFGG)!$]7%;!<g!$]7%;!<g!$]7%;!<g#]##r&   c                    U R                  5       nUR                  U5         [        S0 UD6$ ! [         aP    [	        U5      [	        U R                  5       5      -
  nS[        U5      SR                  U5      4-  n[        U5      ef = f)a  
Replace one or more parts of a version and return a new
:class:`VersionInfo` object, but leave self untouched

.. versionadded:: 2.9.0
   Added :func:`VersionInfo.replace`

:param dict parts: the parts to be updated. Valid keys are:
  ``major``, ``minor``, ``patch``, ``prerelease``, or ``build``
:return: the new :class:`VersionInfo` object with the changed
  parts
:raises: :class:`TypeError`, if ``parts`` contains invalid keys
z3replace() got %d unexpected keyword argument(s): %sr  r!   )rc   updater   r7   setr   rQ   )ri   partsr@   unknownkeyserrors        r%   r   VersionInfo.replace  s     ,,.u	#))) 	#e*s4<<>'::KLK 		+&P E E""	#s
   
. ABc                 H     U R                  U5        g! [         a     gf = f)z
Check if the string is a valid semver version.

.. versionadded:: 2.9.1

:param str version: the version string to check
:return: True if the version string is a valid semver version, False
         otherwise.
:rtype: bool
TF)r   r}   )r   r@   s     r%   isvalidVersionInfo.isvalid  s(    	IIg 		s    
!!)ru   rq   rr   rs   rt   )r   r   NNr   r   )4rM   rU   rC   __firstlineno____doc__	__slots__recompiler   VERBOSEr'  r   propertyrx   setterry   rz   r   r   r   rc   r   r   r   r   staticmethodr   r	   r
   r   r   r   r   r   rn   r   r   r   r   r   r   r   r  r  r  r   r   classmethodr   r   r2  __static_attributes__r!   r&   r%   r   r      s   	 HI::78LZZ	" 	

%F*<,   \\> >   \\> >   \\> >     C C   \\> >Q 
6 5xH I  ''H4hG H ooGO  "$1>F$S$1f.9` ( ( ( ( ' ' ( ( ' ' ( (!F3)7-(^ $ $:#4  r&   r   zsemver.VersionInfo.parser   c                 ,    [         R                  U 5      $ )a  
Parse version string to a VersionInfo instance.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.parse` instead.

.. versionadded:: 2.7.2
   Added :func:`semver.parse_version_info`

:param version: version string
:return: a :class:`VersionInfo` instance
:rtype: :class:`VersionInfo`

>>> version_info = semver.VersionInfo.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   r   ra   s    r%   r   r     s    6 W%%r&   c                    ^	 S m	U	4S jnS nU =(       d    SU=(       d    SpU" U 5      U" U5      pT[        XE5       H  u  pgU" Xg5      nUS:w  d  M  Us  $    [        [        U 5      [        U5      5      $ )Nc                 T    [         R                  " SU 5      (       a  [        U 5      $ U $ )Nz^[0-9]+$)r9  r   r|   )texts    r%   convert_nat_cmp.<locals>.convert,  s!    HHZ66s4y@D@r&   c                 ^   > U R                  S5       Vs/ s H  nT" U5      PM     sn$ s  snf )N.)split)r  crE  s     r%   	split_key_nat_cmp.<locals>.split_key/  s'    $'IIcN3Nq
N333s   *c                     [        U [        5      (       a   [        U[        5      (       a  [        X5      $ [        U [        5      (       a  g[        U[        5      (       a  g[        X5      $ )Nr   r   )r4   r|   r   r"   s     r%   cmp_prerelease_tag$_nat_cmp.<locals>.cmp_prerelease_tag2  sO    a*Q"4"4q933q9r&    r   )zipr   r   )
r#   r$   rK  rN  a_partsb_partssub_asub_b
cmp_resultrE  s
            @r%   r   r   +  sr    A4 7AGq |Yq\WG-'5
? .
 3q63q6""r&   c                 N    [         R                  U 5      nUR                  U5      $ )aX  
Compare two versions strings.

:param ver1: version string 1
:param ver2: version string 2
:return: The return value is negative if ver1 < ver2,
         zero if ver1 == ver2 and strictly positive if ver1 > ver2
:rtype: int

>>> 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   r   r   )ver1ver2r   s      r%   r   r   F  s#    $ 
		4	 B::dr&   c                 N    [         R                  U 5      nUR                  U5      $ )a  
Compare two versions strings through a comparison.

: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   r   r   )r@   r  vers      r%   r   r   \  s#    * 

G
$C99Z  r&   r   z2.10.2c                     [        U [        5      (       a  [        R                  U 5      n O[        U [        5      (       d
  [	        5       eU R                  U5      nUS:  a  [        U 5      $ U$ )z
Returns the greater version of two versions strings.

:param ver1: version string 1
:param ver2: version string 2
:return: the greater version of the two
:rtype: :class:`VersionInfo`

>>> semver.max_ver("1.0.0", "2.0.0")
'2.0.0'
r   )r4   r   r   r   r7   r   r~   rX  rY  r$  s      r%   r   r   u  sZ     $%%  &k**kll4 G!|4yr&   minc                 t    [         R                  U 5      n U R                  U5      nUS::  a  [        U 5      $ U$ )z
Returns the smaller version of two versions strings.

:param ver1: version string 1
:param ver2: version string 2
:return: the smaller version of the two
:rtype: :class:`VersionInfo`

>>> semver.min_ver("1.0.0", "2.0.0")
'1.0.0'
r   )r   r   r   r~   r]  s      r%   r   r     s8     T"Dll4 G!|4yr&   zstr(versionobject)c           	      .    [        [        XX#U5      5      $ )a(  
Format a version string according to the Semantic Versioning specification.

.. deprecated:: 2.10.0
   Use ``str(VersionInfo(VERSION)`` instead.

:param int major: the required major part of a version
:param int minor: the required minor part of a version
:param int patch: the required patch part of a version
:param str prerelease: the optional prerelease part of a version
:param str build: the optional build part of a version
:return: the formatted string
:rtype: str

>>> semver.format_version(3, 4, 5, 'pre.2', 'build.4')
'3.4.5-pre.2+build.4'
)r~   r   r   s        r%   r   r     s    & {5EBCCr&   c                 Z    [        [        R                  U 5      R                  5       5      $ )z
Raise the major part of the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.bump_major` instead.

:param: version string
:return: the raised version string
:rtype: str

>>> semver.bump_major("3.4.5")
'4.0.0'
)r~   r   r   r	   ra   s    r%   r	   r	     #     {  )44677r&   c                 Z    [        [        R                  U 5      R                  5       5      $ )z
Raise the minor part of the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.bump_minor` instead.

:param: version string
:return: the raised version string
:rtype: str

>>> semver.bump_minor("3.4.5")
'3.5.0'
)r~   r   r   r
   ra   s    r%   r
   r
     rb  r&   c                 Z    [        [        R                  U 5      R                  5       5      $ )z
Raise the patch part of the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.bump_patch` instead.

:param: version string
:return: the raised version string
:rtype: str

>>> semver.bump_patch("3.4.5")
'3.4.6'
)r~   r   r   r   ra   s    r%   r   r     rb  r&   c                 \    [        [        R                  U 5      R                  U5      5      $ )a-  
Raise the prerelease part of the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.bump_prerelease` instead.

:param version: version string
:param token: defaults to 'rc'
:return: the raised version string
:rtype: str

>>> semver.bump_prerelease('3.4.5', 'dev')
'3.4.5-dev.1'
)r~   r   r   r   r@   r   s     r%   r   r     s%      {  )99%@AAr&   c                 \    [        [        R                  U 5      R                  U5      5      $ )a/  
Raise the build part of the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.bump_build` instead.

:param version: version string
:param token: defaults to 'build'
:return: the raised version string
:rtype: str

>>> semver.bump_build('3.4.5-rc.1+build.9')
'3.4.5-rc.1+build.10'
)r~   r   r   r   rf  s     r%   r   r     s%      {  )44U;<<r&   c                 ^    [         R                  U 5      n[        UR                  5       5      $ )aW  
Remove any prerelease and build metadata from the version string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.finalize_version` instead.

.. versionadded:: 2.7.9
   Added :func:`finalize_version`

:param version: version string
:return: the finalized version string
:rtype: str

>>> semver.finalize_version('1.2.3-rc.5')
'1.2.3'
)r   r   r~   r   )r@   verinfos     r%   r   r     s(    $ (Gw'')**r&   c                 ^    [        [        R                  U 5      R                  " S0 UD65      $ )a"  
Replace one or more parts of a version and return the new string.

.. deprecated:: 2.10.0
   Use :func:`semver.VersionInfo.replace` instead.

.. versionadded:: 2.9.0
   Added :func:`replace`

:param str version: the version string to replace
:param dict parts: the parts to be updated. Valid keys are:
  ``major``, ``minor``, ``patch``, ``prerelease``, or ``build``
:return: the replaced version string
:raises: TypeError, if ``parts`` contains invalid keys
:rtype: str

>>> import semver
>>> semver.replace("1.2.3", major=2, patch=10)
'2.2.10'
r!   )r~   r   r   r   )r@   r-  s     r%   r   r   *  s(    , {  )11:E:;;r&   c                     SSSSSS.nU R                   c  U R                  R                  SS/5        [        R	                  U R
                  5      n[        X!U R                      5      n[        U" 5       5      $ )	z
Subcommand: Bumps a version.

Synopsis: bump <PART> <VERSION>
<PART> can be major, minor, patch, prerelease, or build

:param args: The parsed arguments
:type args: :class:`argparse.Namespace`
:return: the new, bumped version
r	   r
   r   r   r   r   bumpz-h)rl  parser
parse_argsr   r   r@   r   r~   )rY   maptabler[  r]   s       r%   r   r   D  sq     'H yy 	~.


DLL
)C3+,Dtv;r&   c                 |    [         R                  U R                  5      (       a  g[        SU R                  -  5      e)z
Subcommand: Checks if a string is a valid semver version.

Synopsis: check <VERSION>

:param args: The parsed arguments
:type args: :class:`argparse.Namespace`
NzInvalid version %r)r   r2  r@   r}   rY   s    r%   r   r   a  s1     4<<((
)DLL8
99r&   c                 T    [        [        U R                  U R                  5      5      $ )z
Subcommand: Compare two versions

Synopsis: compare <VERSION1> <VERSION2>

:param args: The parsed arguments
:type args: :class:`argparse.Namespace`
)r~   r   version1version2rq  s    r%   r   r   o  s     wt}}dmm455r&   c                     [         R                  U R                  5      n[        UR	                  U R
                  5      5      $ )z
Subcommand: Determines the next version, taking prereleases into account.

Synopsis: nextver <VERSION> <PART>

:param args: The parsed arguments
:type args: :class:`argparse.Namespace`
)r   r   r@   r~   r   r   )rY   r@   s     r%   cmd_nextverrv  {  s2     -Gw##DII.//r&   c            	      0   [         R                  " [        [        S9n U R	                  SSS[
        -   S9  U R                  5       nUR                  SSS9nUR                  [        S	9  UR	                  S
SS9  UR	                  SSS9  UR                  SSS9nUR                  [        S	9  UR                  SSS9nUR                  SSS9UR                  SSS9UR                  SSS9UR                  SSS9UR                  SSS94 H  nUR	                  SSS9  M     UR                  SSS9nUR                  [        S	9  UR	                  SSS9  UR                  S S!S9nUR                  [        S	9  UR	                  SSS9  UR	                  S"S#S9  U $ )$zy
Create an :class:`argparse.ArgumentParser` instance.

:return: parser instance
:rtype: :class:`argparse.ArgumentParser`
)progdescriptionz	--versionr@   z	%(prog)s )actionr@   r   zCompare two versions)help)r]   rs  zFirst versionrt  zSecond versionrl  zBumps a versionzBump commands)titledestrx   z"Bump the major part of the versionry   z"Bump the minor part of the versionrz   z"Bump the patch part of the versionr   z'Bump the prerelease part of the versionr   z"Bump the build part of the versionzVersion to raisecheckz,Checks if a string is a valid semver versionzVersion to checknextverz=Determines the next version, taking prereleases into account.r   z1One of 'major', 'minor', 'patch', or 'prerelease')argparseArgumentParser__package__r7  add_argument__version__add_subparsers
add_parserset_defaultsr   r   r   rv  )rm  r*   parser_compareparser_bumpsbr   parser_checkparser_nextvers           r%   r   r     s    $$+7KF
I{[/H   	A\\)2H\IN[1
A
1AB ,,v,=,>K(+		#	#/	#	GB 	g$HI
g$HI
g$HI
l)RS
g$HI 	
y'9: <<D   L 9-i.@A \\W " N [1	0BCH    Mr&   c                     [        U S5      (       d$  U R                  R                  5         [        5       eU R	                  U 5      $ )z
Process the input from the CLI.

:param args: The parsed arguments
:type args: :class:`argparse.Namespace`
:param parser: the parser instance
:type parser: :class:`argparse.ArgumentParser`
:return: result of the selected action
:rtype: str
r]   )rL   rm  
print_help
SystemExitr]   rq  s    r%   r   r     s9     4   l 99T?r&   c                      [        5       nUR                  U S9nXl        [        U5      nUb  [	        U5        g! [
        [        4 a#  n[	        SU[        R                  S9   SnAgSnAff = f)z
Entry point for the application script.

:param list cliargs: Arguments to parse or None (=use :class:`sys.argv`)
:return: error code
:rtype: int
rq  Nr   ERROR)filer   )	r   rn  rm  r   printr}   r7   sysstderr)cliargsrm  rY   resulterrs        r%   r   r     sg      g .&M	" gs,s   8; A.A))A.__main__)zutf-8strict)NNr4  r5  r,   )@r7  
__future__r   r  r   	functoolsr   r   rN   r9  r  rR   version_infor9   r:   r  
__author____author_email____maintainer____maintainer_email____all__r   rL   __builtins__r   r~   bytesr   r5   r6   r$   r-   r2   r>   DeprecationWarningr   r   rn   objectr   r   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   rv  r   r   r   rM   doctesttestmodr!   r&   r%   <module>r     s   @ %   $  	 
  
qQ	qQ "
" $o6+ B   |U##!
 :LIK#
 C<LIKD, $?Q /d H0 08z& zz .A& B&:#6 H * H! !0 E8, -. E8, -( ((;D <D* H8 8" H8 8" H8 8" HB B$ H= =$ H+ +* H< <2::	6
03l&. zOO r&   