§
    Ètºfy?  ã                   ó|  — d Z ddlmZmZ ddlZddlZddlZddlmZm	Z	m
Z
mZmZmZmZ ddlmZ erddlZddlmZ ddlmZ d„ Z G d	„ d
e¦  «        Z e¦   «         Z G d„ de¦  «        Z G d„ de¦  «        Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d„ Z# ed¬¦  «         G d„ d¦  «        ¦   «         Z$d„ Z%d„ Z&ddl'm(Z( d„ Z)g d¢Z*dS )z0
Versions for Python packages.

See L{Version}.
é    )ÚdivisionÚabsolute_importN)ÚTYPE_CHECKINGÚAnyÚTypeVarÚUnionÚOptionalÚDictÚBinaryIO)Ú	dataclass)ÚLiteral)ÚDistributionc                 ó&   — | |k     rdS | |k    rdS dS )z‰
    Compare two objects.

    Returns a negative number if C{a < b}, zero if they are equal, and a
    positive number if C{a > b}.
    éÿÿÿÿr   é   © )ÚaÚbs     úS/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/incremental/__init__.pyÚ_cmpr      s%   € ð 	ˆ1‚u€uØˆrØ	
ˆaŠˆØˆqàˆqó    c                   ó0   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ ZdS )Ú_Infz:
    An object that is bigger than all other objects.
    c                 ó   — |t           u rdS dS )z‘
        @param other: Another object.
        @type other: any

        @return: 0 if other is inf, 1 otherwise.
        @rtype: C{int}
        r   r   )Ú_inf©ÚselfÚothers     r   Ú__cmp__z_Inf.__cmp__7   s   € ð •Dˆ=ˆ=Ø�1Øˆqr   c                 ó4   — |                       |¦  «        dk     S ©Nr   ©r   r   s     r   Ú__lt__z_Inf.__lt__C   ó   € Ø�|Š|˜EÑ"Ô" QÒ&Ð&r   c                 ó4   — |                       |¦  «        dk    S r!   r"   r   s     r   Ú__le__z_Inf.__le__F   ó   € Ø�|Š|˜EÑ"Ô" aÒ'Ð'r   c                 ó4   — |                       |¦  «        dk    S r!   r"   r   s     r   Ú__gt__z_Inf.__gt__I   r$   r   c                 ó4   — |                       |¦  «        dk    S r!   r"   r   s     r   Ú__ge__z_Inf.__ge__L   r'   r   N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r#   r&   r)   r+   r   r   r   r   r   2   si   € € € € € ðð ð
ð 
ð 
ð'ð 'ð 'ð(ð (ð (ð'ð 'ð 'ð(ð (ð (ð (ð (r   r   c                   ó   — e Zd ZdZdS )ÚIncomparableVersionsz-
    Two versions could not be compared.
    N)r,   r-   r.   r/   r   r   r   r1   r1   S   s   € € € € € ðð ð ð r   r1   c                   ó€   — e Zd ZdZ	 	 	 	 dd„Zed„ ¦   «         Zd„ ZeZeZ	eZ
d„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ ZdS )ÚVersionzÑ
    An encapsulation of a version for a project, with support for outputting
    PEP-440 compatible version strings.

    This class supports the standard major.minor.micro[rcN] scheme of
    versioning.
    Nc	                 ó  — |r|rt          d¦  «        ‚|r |s|}t          j        dt          d¬¦  «         |dk    r|s|s|s|s|rt          d¦  «        ‚|| _        || _        || _        || _        || _        || _	        || _
        dS )aÒ  
        @param package: Name of the package that this is a version of.
        @type package: C{str}
        @param major: The major version number.
        @type major: C{int} or C{str} (for the "NEXT" symbol)
        @param minor: The minor version number.
        @type minor: C{int}
        @param micro: The micro version number.
        @type micro: C{int}
        @param release_candidate: The release candidate number.
        @type release_candidate: C{int}
        @param prerelease: The prerelease number. (Deprecated)
        @type prerelease: C{int}
        @param post: The postrelease number.
        @type post: C{int}
        @param dev: The development release number.
        @type dev: C{int}
        z Please only return one of these.zvPassing prerelease to incremental.Version was deprecated in Incremental 16.9.0. Please pass release_candidate instead.é   ©Ú
stacklevelÚNEXTz;When using NEXT, all other values except Package must be 0.N)Ú
ValueErrorÚwarningsÚwarnÚDeprecationWarningÚpackageÚmajorÚminorÚmicroÚrelease_candidateÚpostÚdev)	r   r=   r>   r?   r@   rA   Ú
prereleaserB   rC   s	            r   Ú__init__zVersion.__init__b   sÛ   € ð: ð 
	 ð 
	ÝÐ?Ñ@Ô@Ð@Øð 	Ð 1ð 	Ø *ÐÝŒMð-õ #Øðñ ô ð ð �FŠ?ˆ?Øð ˜ð Ð!2ð °dð ¸cð Ý ØQñô ð ð ˆŒØˆŒ
ØˆŒ
ØˆŒ
Ø!2ˆÔØˆŒ	ØˆŒˆˆr   c                 óH   — t          j        dt          d¬¦  «         | j        S )NzuAccessing incremental.Version.prerelease was deprecated in Incremental 16.9.0. Use Version.release_candidate instead.r5   r6   )r:   r;   r<   rA   ©r   s    r   rD   zVersion.prerelease™   s3   € åŒð1õ Øð	
ñ 	
ô 	
ð 	
ð Ô%Ð%r   c                 óÒ   — | j         dk    r| j         S | j        €d}n
d| j        ›�}| j        €d}n
d| j        ›�}| j        €d}n
d| j        ›�}d| j         | j        | j        |||fz  S )zÆ
        Return a PEP440-compatible "public" representation of this L{Version}.

        Examples:

          - 14.4.0
          - 1.2.3rc1
          - 14.2.1rc1dev9
          - 16.04.0dev0
        r8   NÚ Úrcz.postz.devz%r.%d.%d%s%s%s)r>   rA   rB   rC   r?   r@   )r   rJ   rB   rC   s       r   ÚpubliczVersion.public¤   s¡   € ð Œ:˜ÒÐØ”:ÐàÔ!Ð)ØˆBˆBð *ð  Ô1Ð1Ð3ˆBàŒ9ÐØˆDˆDð ð !%¤	 	Ð+ˆDàŒ8ÐØˆCˆCð ð #œh˜hÐ(ˆCà 4¤:¨t¬z¸4¼:ÀrÈ4ÐQTÐ"UÑUÐUr   c           	      óÐ   — | j         €d}n
d| j         ›�}| j        €d}n
d| j        ›�}| j        €d}n
d| j        ›�}d| j        j        | j        | j        | j        | j        |||fz  S )NrI   z, release_candidate=z, post=z, dev=z%s(%r, %r, %d, %d%s%s%s))	rA   rB   rC   Ú	__class__r,   r=   r>   r?   r@   )r   rA   rB   rC   s       r   Ú__repr__zVersion.__repr__Ç   s¦   € ØÔ!Ð)Ø "ÐÐð *ð =AÔ<RÐ<RÐ TÐàŒ9ÐØˆDˆDð ð #'¤) )Ð-ˆDàŒ8ÐØˆCˆCð ð !%¤ Ð*ˆCà)ØŒNÔ#ØŒLØŒJØŒJØŒJØØØð	-
ñ 	
ð 		
r   c                 óB   — d| j         ›d|                      ¦   «         ›d�S )Nú[z
, version ú]©r=   ÚshortrG   s    r   Ú__str__zVersion.__str__â   s!   € € Ø%)¤\ \ \°4·:²:±<´<°<°<Ð@Ð@r   c           	      óž  — t          || j        ¦  «        st          S | j                             ¦   «         |j                             ¦   «         k    rt          | j        ›d|j        ›�¦  «        ‚| j        dk    rt          }n| j        }| j        €t          }n| j        }| j	        €d}n| j	        }| j
        €t          }n| j
        }|j        dk    rt          }n|j        }|j        €t          }n|j        }|j	        €d}n|j	        }|j
        €t          }	n|j
        }	t          || j        | j        |||f||j        |j        |||	f¦  «        }
|
S )aw  
        Compare two versions, considering major versions, minor versions, micro
        versions, then release candidates, then postreleases, then dev
        releases. Package names are case insensitive.

        A version with a release candidate is always less than a version
        without a release candidate. If both versions have release candidates,
        they will be included in the comparison.

        Likewise, a version with a dev release is always less than a version
        without a dev release. If both versions have dev releases, they will
        be included in the comparison.

        @param other: Another version.
        @type other: L{Version}

        @return: NotImplemented when the other object is not a Version, or one
            of -1, 0, or 1.

        @raise IncomparableVersions: when the package names of the versions
            differ.
        z != r8   Nr   )Ú
isinstancerM   ÚNotImplementedr=   Úlowerr1   r>   r   rA   rB   rC   r   r?   r@   )r   r   r>   rA   rB   rC   Ú
othermajorÚotherrcÚ	otherpostÚotherdevÚxs              r   r   zVersion.__cmp__å   sb  € õ. ˜% ¤Ñ0Ô0ð 	"Ý!Ð!ØŒ<×ÒÑÔ 5¤=×#6Ò#6Ñ#8Ô#8Ò8Ð8Ý&°T´\°\°\À5Ä=À=Ð'QÑRÔRÐRàŒ:˜ÒÐÝˆEˆEà”JˆEàÔ!Ð)Ý $ÐÐà $Ô 6ÐàŒ9ÐØˆDˆDà”9ˆDàŒ8ÐÝˆCˆCà”(ˆCàŒ;˜&Ò Ð ÝˆJˆJàœˆJàÔ"Ð*ÝˆGˆGàÔ-ˆGàŒ:ÐØˆIˆIàœ
ˆIàŒ9ÐÝˆHˆHà”yˆHåØ�D”J ¤
Ð,=¸tÀSÐIØ˜œ e¤k°7¸IÀxÐPñ
ô 
ˆð ˆr   c                 óN   — |                       |¦  «        }|t          u r|S |dk    S r!   ©r   rW   ©r   r   Úcs      r   Ú__eq__zVersion.__eq__/  ó,   € Ø�LŠL˜ÑÔˆØ•ÐÐØˆHØ�AŠvˆr   c                 óN   — |                       |¦  «        }|t          u r|S |dk    S r!   r_   r`   s      r   Ú__ne__zVersion.__ne__5  rc   r   c                 óN   — |                       |¦  «        }|t          u r|S |dk     S r!   r_   r`   s      r   r#   zVersion.__lt__;  ó,   € Ø�LŠL˜ÑÔˆØ•ÐÐØˆHØ�1Šuˆr   c                 óN   — |                       |¦  «        }|t          u r|S |dk    S r!   r_   r`   s      r   r&   zVersion.__le__A  rc   r   c                 óN   — |                       |¦  «        }|t          u r|S |dk    S r!   r_   r`   s      r   r)   zVersion.__gt__G  rg   r   c                 óN   — |                       |¦  «        }|t          u r|S |dk    S r!   r_   r`   s      r   r+   zVersion.__ge__M  rc   r   )NNNN)r,   r-   r.   r/   rE   ÚpropertyrD   rK   ÚbaserS   ÚlocalrN   rT   r   rb   re   r#   r&   r)   r+   r   r   r   r3   r3   Y   s  € € € € € ðð ð ØØØð5ð 5ð 5ð 5ðn ð&ð &ñ „Xð&ðVð Vð Vð> €DØ€EØ€Eð
ð 
ð 
ð6Að Að AðHð Hð HðTð ð ðð ð ðð ð ðð ð ðð ð ðð ð ð ð r   r3   c                 óB   — | j         ›d|                      ¦   «         ›�}|S )z®
    Get a friendly string for the given version object.

    @param version: A L{Version} object.
    @return: A string containing the package and short version number.
    ú rR   )ÚversionÚresults     r   ÚgetVersionStringrr   T  s#   € ð  œ˜˜¨¯ª©¬¨Ð9€FØ€Mr   c                 ó˜  — t           j                             | d|                     ¦   «         ¦  «        }t           j                             | |                     ¦   «         ¦  «        }t           j                             |¦  «        r|S t           j                             |¦  «        r|S t          d                     |||¦  «        ¦  «        ‚)zš
    Determine the package root directory.

    The result is one of:

        - src/{package}
        - {package}

    Where {package} is downcased.
    Úsrcz=Can't find the directory of project {}: I looked in {} and {})ÚosÚpathÚjoinrX   Úisdirr9   Úformat)rv   r=   Úsrc_dirÚcurrent_dirs       r   Ú	_findPathr|   _  s£   € õ Œg�lŠl˜4 ¨¯ª©¬Ñ8Ô8€GÝ”'—,’,˜t W§]¢]¡_¤_Ñ5Ô5€Kå	„w‡}‚}�WÑÔð 	
ØˆÝ	Œ�Š�{Ñ	#Ô	#ð 
ØÐåØK×RÒRØ˜ +ñô ñ
ô 
ð 	
r   c                 óª   — i }t          | d¦  «        5 }t          |                     ¦   «         |¦  «         ddd¦  «         n# 1 swxY w Y   |d         S )z?
    Load the current version from a ``_version.py`` file.
    ÚrNÚ__version__)ÚopenÚexecÚread)Úversion_pathÚversion_infoÚfs      r   Ú_existing_versionr†   y  s�   € ð €Lå	ˆl˜CÑ	 Ô	 ð % AÝˆQ�VŠV‰XŒX�|Ñ$Ô$Ð$ð%ð %ð %ñ %ô %ð %ð %ð %ð %ð %ð %øøøð %ð %ð %ð %ð ˜Ô&Ð&s   “#AÁAÁ	Ac                 óæ   — 	 t          d¦  «        }n# t          $ r Y dS w xY w|j        sdS 	 t          |j        ¦  «        }n# t
          $ r Y dS w xY w|                     ¦   «         | j        _        dS )a’  
    Setuptools integration: load the version from the working directory

    This function is registered as a setuptools.finalize_distribution_options
    entry point [1]. Consequently, it is called in all sorts of weird
    contexts. In setuptools, silent failure is the law.

    [1]: https://setuptools.pypa.io/en/latest/userguide/extension.html#customizing-distribution-options

    @param dist:
        A (possibly) empty C{setuptools.Distribution} instance to mutate.
        There may be some metadata here if a `setup.py` called `setup()`,
        but this hook is always called before setuptools loads anything
        from ``pyproject.toml``.
    z./pyproject.tomlN)	Ú_load_pyproject_tomlÚ	ExceptionÚopt_inr†   rƒ   ÚFileNotFoundErrorrK   Úmetadatarp   )ÚdistÚconfigrp   s      r   Ú_get_setuptools_versionr�   …  s¡   € ð õ &Ð&8Ñ9Ô9ˆˆøÝð ð ð Øˆˆðøøøð Œ=ð ØˆðÝ# FÔ$7Ñ8Ô8ˆˆøÝð ð ð Øˆˆðøøøð $ŸNšNÑ,Ô,€D„MÔÐÐs   ‚ ’
 Ÿ ­A Á
AÁAc                 ó®  — |sdS ddl m} |                     | ¦  «        }|                     ¦   «          |                     ¦   «         D ]}|d         dk    rqt          j                             t          j                             |d         ¦  «        d¦  «        }t          |¦  «         	                    ¦   «         | j
        _         dS Œ€t          d¦  «        ‚)	a  
    Distutils integration: get the version from the package listed in the Distribution.

    This function is invoked when a C{setup.py} calls C{setup(use_incremental=True)}.

    @see: https://setuptools.pypa.io/en/latest/userguide/extension.html#adding-arguments
    Nr   )Úbuild_pyr   Ú_versionr5   ú_version.pyzNo _version.py found.)Úsetuptools.commandr‘   Úfinalize_optionsÚfind_all_modulesru   rv   rw   Údirnamer†   rK   rŒ   rp   r‰   )r�   ÚkeywordÚvaluer‘   Ú
sp_commandÚitemrƒ   s          r   Ú_get_distutils_versionrœ   ¨  sÔ   € ð ð Øˆà+Ð+Ð+Ð+Ð+Ð+à×"Ò" 4Ñ(Ô(€JØ×ÒÑ!Ô!Ð!à×+Ò+Ñ-Ô-ð ð ˆØ�Œ7�jÒ Ð Ýœ7Ÿ<š<­¬¯ª¸¸Q¼Ñ(@Ô(@À-ÑPÔPˆLÝ$5°lÑ$CÔ$C×$JÒ$JÑ$LÔ$LˆDŒMÔ!ØˆFˆFð !õ
 Ð+Ñ
,Ô
,Ð,r   c                 ó^   — t           j        dk    rddl}nddl}|                     | ¦  «        S )z*
    Read the content of a TOML file.
    )é   é   r   N)Úsysr„   ÚtomllibÚtomliÚload)r…   r¡   s     r   Ú
_load_tomlr¤   Á  s9   € õ Ô˜'Ò!Ð!ØˆˆˆˆàÐÐÐà�<Š<˜‰?Œ?Ðr   T)Úfrozenc                   óN   — e Zd ZU dZeed<   	 eed<   	 eed<   	 ed„ ¦   «         ZdS )Ú_IncrementalConfigz>
    Configuration loaded from a ``pyproject.toml`` file.
    rŠ   r=   rv   c                 óL   — t           j                             | j        d¦  «        S )z0Path of the ``_version.py`` file. May not exist.r“   )ru   rv   rw   rG   s    r   rƒ   z_IncrementalConfig.version_pathâ  s   € õ Œw�|Š|˜DœI }Ñ5Ô5Ð5r   N)	r,   r-   r.   r/   ÚboolÚ__annotations__Ústrrk   rƒ   r   r   r   r§   r§   Ï  sc   € € € € € € ðð ð €L€L�Lðð €L€L�LØCà
€I€I�IØ"àð6ð 6ñ „Xð6ð 6ð 6r   r§   c           	      ó  — t          | d¦  «        5 }t          |¦  «        }ddd¦  «         n# 1 swxY w Y   t          |¦  «        }d}|�d|v r|d         }|€ 	 |d         d         }n# t          $ r Y nw xY w|€t	          d¦  «        ‚t          |t          ¦  «        s/t          d                     t          |¦  «        ¦  «        ¦  «        ‚t          |du|t          t          j                             | ¦  «        |¦  «        ¬¦  «        S )aƒ  
    Load Incremental configuration from a ``pyproject.toml``

    If the [tool.incremental] section is empty we take the project name
    from the [project] section. Otherwise we require only a C{name} key
    specifying the project name. Other keys are forbidden to allow future
    extension and catch typos.

    @param toml_path:
        Path to the ``pyproject.toml`` to load.
    ÚrbNÚnameÚprojectz¤Incremental failed to extract the project name from pyproject.toml. Specify it like:

    [project]
    name = "Foo"

Or:

    [tool.incremental]
    name = "Foo"

z/The project name must be a string, but found {})rŠ   r=   rv   )r€   r¤   Ú_extract_tool_incrementalÚKeyErrorr9   rV   r«   Ú	TypeErrorry   Útyper§   r|   ru   rv   r—   )Ú	toml_pathr…   ÚdataÚtool_incrementalr=   s        r   rˆ   rˆ   è  su  € õ 
ˆi˜Ñ	Ô	ð  !Ý˜!‰}Œ}ˆðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð õ 1°Ñ6Ô6Ðð €GØÐ#¨Ð2BÐ(BÐ(BØ" 6Ô*ˆØ€ð	Ø˜9”o fÔ-ˆGˆGøÝð 	ð 	ð 	ØˆDð	øøøà€åð ñ ô ð 	õ �g�sÑ#Ô#ð 
ÝØ=×DÒDÅTÈ'Á]Ä]ÑSÔSñ
ô 
ð 	
õ Ø tÐ+ØÝ•r”w—’ yÑ1Ô1°7Ñ;Ô;ðñ ô ð s   ‘-­1´1ÁA) Á)
A6Á5A6c                 óP  — d| vrd S t          | d         t          ¦  «        st          d¦  «        ‚d| d         vrd S | d         d         }t          |t          ¦  «        st          d¦  «        ‚dh                     |                     ¦   «         ¦  «        st          d¦  «        ‚|S )NÚtoolz[tool] must be a tableÚincrementalz"[tool.incremental] must be a tabler®   z'Unexpected key(s) in [tool.incremental])rV   Údictr9   Ú
issupersetÚkeys)rµ   r¶   s     r   r°   r°     s·   € Ø�TÐÐØˆtÝ�d˜6”l¥DÑ)Ô)ð 3ÝÐ1Ñ2Ô2Ð2Ø˜D œLÐ(Ð(Øˆtà˜F”| MÔ2ÐÝÐ&­Ñ-Ô-ð ?ÝÐ=Ñ>Ô>Ð>àˆ8×ÒÐ/×4Ò4Ñ6Ô6Ñ7Ô7ð DÝÐBÑCÔCÐCØÐr   r   )r   c                  ó(   — t          j        ¦   «         S )N)r   rK   r   r   r   Ú_setuptools_versionr¾   1  s   € ÝÔÑÔÐr   )r   r3   rr   )+r/   Ú
__future__r   r   ru   r    r:   Útypingr   r   r   r   r	   r
   r   Údataclassesr   ÚioÚtyping_extensionsr   Údistutils.distr   Ú_Distributionr   Úobjectr   r   r²   r1   r3   rr   r|   r†   r�   rœ   r¤   r§   rˆ   r°   r’   r   r¾   Ú__all__r   r   r   ú<module>rÈ      sV  ððð ð 1Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0à 	€	€	€	Ø 
€
€
€
Ø €€€Ø OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OÐ OØ !Ð !Ð !Ð !Ð !Ð !ð ð =Ø€I€I€IØ)Ð)Ð)Ð)Ð)Ð)Ø<Ð<Ð<Ð<Ð<Ð<ðð ð ð((ð (ð (ð (ð (ˆ6ñ (ô (ð (ð< €t�v„v€ðð ð ð ð ˜9ñ ô ð ðxð xð xð xð xˆfñ xô xð xðvð ð ð
ð 
ð 
ð4	'ð 	'ð 	'ð -ð  -ð  -ðF-ð -ð -ð2ð ð ð €�$ÐÑÔð6ð 6ð 6ð 6ð 6ñ 6ô 6ñ Ôð6ð02ð 2ð 2ðjð ð ð" "Ð !Ð !Ð !Ð !Ð !ð ð  ð  ð 9Ð
8Ð
8€€€r   