a
    é´«j}\  ã                   @   s^  U d Z ddlZddlZddlZddlZddlZddlZddlmZ dd„ Z	G dd„ dƒZ
dd	„ ZG d
d„ deƒZi Zeeef ed< i Zeeeeef f ed< dd„ Zd7dd„Zdd„ Zeddƒdd„ ƒZeddƒdd„ ƒZeddƒefdd„ƒZedœdd „Zd!d"„ Zd#d$„ Zd%d&„ Zd'd(„ Zd)d*„ Zd+d,„ Zd-d.„ Z d/d0„ Z!d1d2„ Z"d3d4„ Z#d5d6„ Z$dS )8z"Git implementation of _version.py.é    N)ÚCallablec                  C   s   d} d}d}| ||dœ}|S )z;Get the keywords needed to look up the version information.z" (HEAD, tag: v2.3.3, origin/2.3.x)Z(9c8bc3e55188c8aff37207a74f1dd144980b8874z2025-09-30 00:12:09 +0200)ÚrefnamesÚfullÚdate© )Zgit_refnamesZgit_fullZgit_dateÚkeywordsr   r   úN/var/www/html/laksyashrimp/venv/lib/python3.9/site-packages/pandas/_version.pyÚget_keywords   s
    r	   c                   @   s   e Zd ZdZdS )ÚVersioneerConfigz2Container for Versioneer configuration parameters.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r
   #   s   r
   c                  C   s.   t ƒ } d| _d| _d| _d| _d| _d| _| S )z:Create, populate and return the VersioneerConfig() object.ÚgitÚpep440Úvzpandas-zpandas/_version.pyF)r
   ZVCSÚstyleÚ
tag_prefixÚparentdir_prefixÚversionfile_sourceÚverbose)Úcfgr   r   r   Ú
get_config'   s    r   c                   @   s   e Zd ZdZdS )ÚNotThisMethodzCException raised if a method is not valid for the current scenario.Nr   r   r   r   r   r   5   s   r   ÚLONG_VERSION_PYÚHANDLERSc                    s   ‡ ‡fdd„}|S )z:Create decorator to mark a method as the handler of a VCS.c                    s    ˆt vri t ˆ< | t ˆ ˆ < | S )z!Store f in HANDLERS[vcs][method].)r   )Úf©ÚmethodÚvcsr   r   Údecorate@   s    z&register_vcs_handler.<locals>.decorater   )r    r   r!   r   r   r   Úregister_vcs_handler=   s    r"   Fc              	   C   sL  t | tƒsJ ‚d}i }tjdkr@t ¡ }| jtjO  _||d< | D ]˜}	t|	g| ƒ}
z8tj	|	g| f||tj
|rxtj
nddœ|¤Ž}W  qôW qD tyÚ   t ¡ d }|jtjkr¸Y qD|rÒtd|
› �ƒ t|ƒ Y  dS 0 qD|rðtd| › �ƒ dS | ¡ d	  ¡  ¡ }|jd	k�rB|�r8td|
› d
�ƒ td|› �ƒ d|jfS ||jfS )zCall the given command(s).NÚwin32Ústartupinfo)ÚcwdÚenvÚstdoutÚstderré   zunable to run )NNzunable to find command, tried r   z (error)zstdout was )Ú
isinstanceÚlistÚsysÚplatformÚ
subprocessZSTARTUPINFOZdwFlagsZSTARTF_USESHOWWINDOWÚstrÚPopenÚPIPEÚOSErrorÚexc_infoÚerrnoÚENOENTÚprintÚcommunicateÚstripÚdecodeÚ
returncode)ÚcommandsÚargsr%   r   Úhide_stderrr&   ÚprocessZpopen_kwargsr$   ÚcommandZdispcmdÚer'   r   r   r   Úrun_commandJ   sN    
ÿûú

rA   c                 C   s†   g }t dƒD ]P}tj |¡}| | ¡rF|t| ƒd… dddddœ  S | |¡ tj |¡}q|rztdt	|ƒ› d| › �ƒ t
dƒ‚dS )a"  Try to determine the version from the parent directory name.

    Source tarballs conventionally unpack into a directory that includes both
    the project name and a version string. We will also support searching up
    two directory levels for an appropriately named parent directory
    é   NF©Úversionzfull-revisionidÚdirtyÚerrorr   zTried directories z*             but none started with prefix z+rootdir doesn't start with parentdir_prefix)ÚrangeÚosÚpathÚbasenameÚ
startswithÚlenÚappendÚdirnamer6   r/   r   )r   Úrootr   ZrootdirsÚ_rN   r   r   r   Úversions_from_parentdirx   s&    
û

ÿÿrQ   r   c                 C   sÚ   i }z¾t | dd��ž}|D ]ˆ}| ¡  d¡rHt d|¡}|rH| d¡|d< | ¡  d¡rtt d|¡}|rt| d¡|d< | ¡  d	¡rt d|¡}|r| d¡|d
< qW d  ƒ n1 s¶0    Y  W n tyÔ   Y n0 |S )z0Extract version information from the given file.zutf-8)Úencodingzgit_refnames =z
=\s*"(.*)"r)   r   z
git_full =r   z
git_date =r   N)Úopenr8   rK   ÚreÚsearchÚgroupr2   )Zversionfile_absr   ZfobjÚlineÚmor   r   r   Úgit_get_keywords–   s&    2rY   r   c           	         s~  d| vrt dƒ‚|  d¡}|durJ| ¡ d }| ¡  ddd¡ dd	d¡}| d  ¡ }| d
¡rt|rltdƒ t dƒ‚dd„ | d¡ d¡D ƒ}d‰ ‡ fdd„|D ƒ}|sÔdd„ |D ƒ}|rÔtdd || ¡› d�ƒ |rðtdd t	|ƒ¡› �ƒ t	|ƒD ]^}| |¡rø|t
|ƒd… }t d|¡�s&qø|�r:td|› �ƒ || d  ¡ dd|dœ  S qø|�rftdƒ d| d  ¡ ddddœS )z*Get version information from git keywords.r   zShort version file foundr   Néÿÿÿÿú ÚTr)   Ú z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballc                 S   s   h | ]}|  ¡ ’qS r   )r8   ©Ú.0Úrr   r   r   Ú	<setcomp>É   ó    z-git_versions_from_keywords.<locals>.<setcomp>z()ú,ztag: c                    s&   h | ]}|  ˆ ¡r|tˆ ƒd … ’qS )N)rK   rL   r^   ©ZTAGr   r   ra   Í   rb   c                 S   s   h | ]}t  d |¡r|’qS )ú\d)rT   rU   r^   r   r   r   ra   Ö   rb   zdiscarding 'z', no digitszlikely tags: re   zpicking r   FrC   z2no suitable tags, using unknown + full revision idú	0+unknownzno suitable tags)r   ÚgetÚ
splitlinesr8   ÚreplacerK   r6   ÚsplitÚjoinÚsortedrL   rT   Úmatch)	r   r   r   r   r   ÚrefsÚtagsÚrefr`   r   rd   r   Úgit_versions_from_keywords²   sR    



û
ûrq   Zpieces_from_vcsc              
   C   s2  dg}t jdkrddg}tj ¡ }| dd¡ tj||d�}||dd	g|| d
�\}}|dkrz|rrtd|› d�ƒ t	dƒ‚||dddddd| › d�g|d�\}}|du r°t	dƒ‚| 
¡ }||ddg|d�\}	}|	du rÞt	dƒ‚|	 
¡ }	i }
|	|
d< |	dd… |
d< d|
d< ||g d¢|d�\}}|dk�s4|du �r<t	dƒ‚| 
¡ }|dk�rÔ||d d!g|d�\}}|dk�sx|du �r€t	d"ƒ‚| d#¡}d$|d v �r¢| d¡ d%d&„ |D ƒ}d'|v �rÀd'}n|�sÌd}n|d }||
d < |}| d(¡}||
d)< |�r
|d| d(¡… }d*|v �rºt d+|¡}|�s:d,|› d-�|
d< |
S | d.¡}| | ¡�s„|�rjd/}t||| f ƒ d0|› d1| › d-�|
d< |
S |t| ƒd… |
d2< t| d3¡ƒ|
d4< | d5¡|
d< n.d|
d2< ||g d6¢|d�\}}t| ¡ ƒ|
d4< ||g d7¢|d�d  
¡ }| ¡ d8 }| 
¡  d9d:d.¡ d9d;d.¡|
d<< |
S )=a  Get version from 'git describe' in the root of the source tree.

    This only gets called if the git-archive 'subst' keywords were *not*
    expanded, and _version.py hasn't already been rewritten with a short
    version string, meaning we're inside a checked out source tree.
    r   r#   zgit.cmdzgit.exeÚGIT_DIRN)r&   ú	rev-parsez	--git-dir)r%   r=   r   z
Directory z not under git controlz('git rev-parse --git-dir' returned errorZdescribez--tagsz--dirtyz--alwaysz--longz--matchz[[:digit:]]*)r%   z'git describe' failedÚHEADz'git rev-parse' failedÚlongé   ÚshortrF   )rs   z--abbrev-refrt   z+'git rev-parse --abbrev-ref' returned errorÚbranchz
--containsz&'git branch --contains' returned errorÚ
ú(c                 S   s   g | ]}|d d… ‘qS )é   Nr   )r_   rx   r   r   r   Ú
<listcomp>D  rb   z'git_pieces_from_vcs.<locals>.<listcomp>Úmasterú-dirtyrE   ú-z^(.+)-(\d+)-g([0-9a-f]+)$z&unable to parse git-describe output: 'ú'r)   z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix 'úclosest-tagr{   ÚdistancerB   )zrev-listrt   z--left-right)Úshowz-sz--format=%cirt   rZ   r[   r\   r]   r   )r,   r-   rH   ÚenvironÚcopyÚpopÚ	functoolsÚpartialr6   r   r8   rj   ÚendswithÚrindexrT   rU   rV   rK   rL   Úintrh   ri   )r   rO   r   ÚrunnerZGITSr&   rP   ÚrcZdescribe_outZfull_outÚpiecesÚbranch_nameZbranchesZgit_describerE   rX   Zfull_tagÚfmtÚoutr   r   r   r   Úgit_pieces_from_vcsù   s¤    

ù	õ







þÿ r’   )Úreturnc                 C   s   d|   dd¡v rdS dS )z8Return a + if we don't already have one, else return a .ú+r�   r]   Ú.)rg   )rŽ   r   r   r   Úplus_or_dot…  s    r–   c                 C   s„   | d rX| d }| d s | d r€|t | ƒ7 }|| d › d| d › �7 }| d r€|d7 }n(d| d › d| d › �}| d r€|d7 }|S )a,  Build up version string, with post-release "local version identifier".

    Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
    get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirty

    Exceptions:
    1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]
    r�   r‚   rE   ú.grw   ú.dirtyz0+untagged.©r–   ©rŽ   Úrenderedr   r   r   Úrender_pep440Œ  s    	
rœ   c                 C   s´   | d rl| d }| d s | d r°| d dkr4|d7 }|t | ƒ7 }|| d › d| d › �7 }| d r°|d	7 }nDd
}| d dkr„|d7 }|d| d › d| d › �7 }| d r°|d	7 }|S )zÿTAG[[.dev0]+DISTANCE.gHEX[.dirty]] .

    The ".dev0" means not master branch. Note that .dev0 sorts backwards
    (a feature branch will appear "older" than the master branch).

    Exceptions:
    1: no tags. 0[.dev0]+untagged.DISTANCE.gHEX[.dirty]
    r�   r‚   rE   rx   r}   ú.dev0r—   rw   r˜   Ú0z
+untagged.r™   rš   r   r   r   Úrender_pep440_branch¤  s     	
rŸ   c                 C   s4   t  | d¡}|d t|ƒdkr.t|d p*dƒndfS )zÎSplit pep440 version string at the post-release segment.

    Returns the release segments before the post-release and the
    post-release version number (or -1 if no post-release segment is present).
    ú.postr   r{   r)   N)r/   rj   rL   r‹   )ÚverÚvcr   r   r   Úpep440_split_postÁ  s    r£   c                 C   sz   | d rh| d r^t | d ƒ\}}|}|durJ|d|d › d| d › �7 }qf|d| d › �7 }qv| d }nd| d › �}|S )	z_TAG[.postN.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post0.devDISTANCE
    r�   r‚   Nr    r)   z.devz
.post0.devz0.post0.dev)r£   )rŽ   Ztag_versionZpost_versionr›   r   r   r   Úrender_pep440_preË  s    
r¤   c                 C   s–   | d rb| d }| d s | d r’|d| d › �7 }| d rB|d7 }|t | ƒ7 }|d| d › �7 }n0d| d › �}| d r€|d7 }|d	| d › �7 }|S )
a$  TAG[.postDISTANCE[.dev0]+gHEX] .

    The ".dev0" means dirty. Note that .dev0 sorts backwards
    (a dirty tree will appear "older" than the corresponding clean one),
    but you shouldn't be releasing software with -dirty anyways.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r�   r‚   rE   r    r�   Úgrw   ú0.postú+gr™   rš   r   r   r   Úrender_pep440_postã  s    
r¨   c                 C   s¾   | d rv| d }| d s | d rº|d| d › �7 }| d dkrF|d7 }|t | ƒ7 }|d| d	 › �7 }| d rº|d
7 }nDd| d › �}| d dkr˜|d7 }|d| d	 › �7 }| d rº|d
7 }|S )z›TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .

    The ".dev0" means not master branch.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty]
    r�   r‚   rE   r    rx   r}   r�   r¥   rw   r˜   r¦   r§   r™   rš   r   r   r   Úrender_pep440_post_branchþ  s"    
r©   c                 C   sf   | d rD| d }| d s | d rb|d| d › �7 }| d rb|d7 }nd| d › �}| d rb|d7 }|S )zuTAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r�   r‚   rE   r¦   r�   r   rš   r   r   r   Úrender_pep440_old  s    
rª   c                 C   sR   | d r6| d }| d r>|d| d › d| d › �7 }n| d }| d rN|d7 }|S )z—TAG[-DISTANCE-gHEX][-dirty].

    Like 'git describe --tags --dirty --always'.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    r�   r‚   r   ú-grw   rE   r~   r   rš   r   r   r   Úrender_git_describe1  s    r¬   c                 C   sJ   | d r.| d }|d| d › d| d › �7 }n| d }| d rF|d7 }|S )zÃTAG-DISTANCE-gHEX[-dirty].

    Like 'git describe --tags --dirty --always -long'.
    The distance/hash is unconditional.

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    r�   r   r‚   r«   rw   rE   r~   r   rš   r   r   r   Úrender_git_describe_longE  s    	r­   c                 C   sð   | d r"d|   d¡d| d ddœS |r.|dkr2d}|dkrDt| ƒ}nŽ|dkrVt| ƒ}n||d	krht| ƒ}nj|d
krzt| ƒ}nX|dkrŒt| ƒ}nF|dkržt| ƒ}n4|dkr°t| ƒ}n"|dkrÂt| ƒ}nt	d|› d�ƒ‚|| d | d d|   d¡dœS )z9Render the given version pieces into the requested style.rF   Úunknownru   NrC   Údefaultr   zpep440-branchz
pep440-prezpep440-postzpep440-post-branchz
pep440-oldzgit-describezgit-describe-longzunknown style 'r€   rE   r   )
rg   rœ   rŸ   r¤   r¨   r©   rª   r¬   r­   Ú
ValueError)rŽ   r   r›   r   r   r   ÚrenderY  s@    û







ûr±   c               	   C   sò   t ƒ } | j}zttƒ | j|ƒW S  ty0   Y n0 z.tj t	¡}| j
 d¡D ]}tj |¡}qLW n" ty‚   ddddddœ Y S 0 zt| j||ƒ}t|| jƒW S  ty²   Y n0 z| jrÌt| j||ƒW S W n tyà   Y n0 ddddddœS )z=Get version information or return default if unable to do so.ú/rf   Nz"unable to find root of source treerC   zunable to compute version)r   r   rq   r	   r   r   rH   rI   ÚrealpathÚ__file__r   rj   rN   Ú	NameErrorr’   r±   r   r   rQ   )r   r   rO   rP   rŽ   r   r   r   Úget_versionsƒ  sB    ûûr¶   )NFFN)%r   r4   r‡   rH   rT   r.   r,   Útypingr   r	   r
   r   Ú	Exceptionr   r   Údictr/   Ú__annotations__r   r"   rA   rQ   rY   rq   r’   r–   rœ   rŸ   r£   r¤   r¨   r©   rª   r¬   r­   r±   r¶   r   r   r   r   Ú<module>   sF   
.

F 
*