o
    �¨Êh<\  ã                   @   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def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$Format:%d$z$Format:%H$z$Format:%ci$)ÚrefnamesÚfullÚdate© )Úgit_refnamesÚgit_fullÚgit_dateÚkeywordsr   r   úA/var/www/html/env/lib/python3.10/site-packages/pandas/_version.pyÚget_keywords   s
   r   c                   @   ó   e Zd ZdZdS )ÚVersioneerConfigz2Container for Versioneer configuration parameters.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   #   ó    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   ÚVCSÚstyleÚ
tag_prefixÚparentdir_prefixÚversionfile_sourceÚverbose)Úcfgr   r   r   Ú
get_config'   s   r   c                   @   r   )ÚNotThisMethodzCException raised if a method is not valid for the current scenario.Nr   r   r   r   r   r    5   r   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   sB  t | tƒsJ ‚d}i }tjdkr t ¡ }| jtjO  _||d< | D ]I}	t|	g| ƒ}
ztj	|	g| f||tj
|r<tj
nddœ|¤Ž}W  n1 tyk   t ¡ d }|jtjkrZY q"|rgtd|
› �ƒ t|ƒ Y  dS w |rutd| › �ƒ dS | ¡ d	  ¡  ¡ }|jd	krœ|r—t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Ú
subprocessÚSTARTUPINFOÚdwFlagsÚSTARTF_USESHOWWINDOWÚstrÚPopenÚPIPEÚOSErrorÚexc_infoÚerrnoÚENOENTÚprintÚcommunicateÚstripÚdecodeÚ
returncode)ÚcommandsÚargsr+   r   Úhide_stderrr,   ÚprocessÚpopen_kwargsr*   ÚcommandÚdispcmdÚer-   r   r   r   Úrun_commandJ   sP   
ÿûúù	


rL   c                 C   s‚   g }t dƒD ](}tj |¡}| | ¡r#|t| ƒd… dddddœ  S | |¡ tj |¡}q|r=tdt	|ƒ› d| › �ƒ t
dƒ‚)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Údirnamer?   r8   r    )r   Úrootr   ÚrootdirsÚ_rY   r   r   r   Úversions_from_parentdirx   s&   

û
ÿÿr]   r   c                 C   sÞ   i }zbt | dd��Q}|D ]D}| ¡  d¡r$t d|¡}|r$| d¡|d< | ¡  d¡r:t d|¡}|r:| d¡|d< | ¡  d	¡rPt d|¡}|rP| d¡|d
< qW d  ƒ W |S 1 s]w   Y  W |S  tyn   Y |S w )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)ÚopenrA   rV   ÚreÚsearchÚgroupr;   )Úversionfile_absr
   ÚfobjÚlineÚmor   r   r   Úgit_get_keywords–   s4   €ôÿðþþrg   r
   c           	         sx  d| vrt dƒ‚|  d¡}|dur%| ¡ d }| ¡  ddd¡ dd	d¡}| d  ¡ }| d
¡r:|r6tdƒ t dƒ‚dd„ | d¡ d¡D ƒ}d‰ ‡ fdd„|D ƒ}|sjdd„ |D ƒ}|rjtdd || ¡› d�ƒ |rxtdd t	|ƒ¡› �ƒ t	|ƒD ]-}| |¡r©|t
|ƒd… }t d|¡s’q||r›td|› �ƒ || d  ¡ dd|dœ  S q||r°t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   )rA   ©Ú.0Úrr   r   r   Ú	<setcomp>É   s    z-git_versions_from_keywords.<locals>.<setcomp>z()ú,ztag: c                    s&   h | ]}|  ˆ ¡r|tˆ ƒd … ’qS )N)rV   rW   rl   ©ÚTAGr   r   ro   Í   s   & c                 S   s   h | ]
}t  d |¡r|’qS )ú\d)r`   ra   rl   r   r   r   ro   Ö   s    zdiscarding 'z', no digitszlikely tags: rs   zpicking r   FrN   z2no suitable tags, using unknown + full revision idú	0+unknownzno suitable tags)r    ÚgetÚ
splitlinesrA   ÚreplacerV   r?   ÚsplitÚjoinÚsortedrW   r`   Úmatch)	r
   r   r   r   r   ÚrefsÚtagsÚrefrn   r   rq   r   Úgit_versions_from_keywords²   sT   




û÷
ûr   Úpieces_from_vcsc              
   C   s   dg}t jdkrddg}tj ¡ }| dd¡ tj||d�}||dd	g|| d
�\}}|dkr=|r9td|› d�ƒ t	dƒ‚||dddddd| › d�g|d�\}}|du rXt	dƒ‚| 
¡ }||ddg|d�\}	}|	du rot	dƒ‚|	 
¡ }	i }
|	|
d< |	dd… |
d< d|
d< ||g d¢|d�\}}|dks˜|du rœt	dƒ‚| 
¡ }|dkrâ||d d!g|d�\}}|dks·|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 �rTt d+|¡}|�sd,|› d-�|
d< |
S | d.¡}| | ¡�s9|�r,d/}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+   rF   r   z
Directory z not under git controlz('git rev-parse --git-dir' returned errorÚdescribez--tagsz--dirtyz--alwaysz--longz--matchz[[:digit:]]*)r+   z'git describe' failedÚHEADz'git rev-parse' failedÚlongé   ÚshortrQ   )r‚   z--abbrev-refr„   z+'git rev-parse --abbrev-ref' returned errorÚbranchz
--containsz&'git branch --contains' returned errorÚ
ú(c                 S   s   g | ]}|d d… ‘qS )é   Nr   )rm   rˆ   r   r   r   Ú
<listcomp>D  s    z'git_pieces_from_vcs.<locals>.<listcomp>Úmasterú-dirtyrP   ú-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‹   ÚdistancerM   )zrev-listr„   z--left-right)Úshowz-sz--format=%cir„   rh   ri   rj   rk   r   )r2   r3   rS   ÚenvironÚcopyÚpopÚ	functoolsÚpartialr?   r    rA   rx   ÚendswithÚrindexr`   ra   rb   rV   rW   Úintrv   rw   )r   rZ   r   ÚrunnerÚGITSr,   r\   ÚrcÚdescribe_outÚfull_outÚpiecesÚbranch_nameÚbranchesÚgit_describerP   rf   Ú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‘   rk   Ú.)ru   )r¡   r   r   r   Úplus_or_dot…  s   r¬   c                 C   s†   | d r-| d }| d s| d r+|t | ƒ7 }|| d › d| d › �7 }| d r+|d7 }|S d| d › d| d › �}| d rA|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’   rP   ú.gr‡   ú.dirtyz0+untagged.©r¬   ©r¡   Úrenderedr   r   r   Úrender_pep440Œ  s   	ýr²   c                 C   s¶   | d r7| d }| d s| d r5| d dkr|d7 }|t | ƒ7 }|| d › d| d › �7 }| d r5|d	7 }|S d
}| d dkrC|d7 }|d| d › d| d › �7 }| d rY|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’   rP   rˆ   r�   ú.dev0r­   r‡   r®   Ú0z
+untagged.r¯   r°   r   r   r   Úrender_pep440_branch¤  s"   		úrµ   c                 C   s6   t  | d¡}|d t|ƒdkrt|d pdƒfS 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)r8   rx   rW   r›   )ÚverÚvcr   r   r   Úpep440_split_postÁ  s   *r¹   c                 C   s€   | d r7| d r1t | d ƒ\}}|}|dur&|d|d › d| d › �7 }|S |d| d › �7 }|S | d }|S 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¡   Útag_versionÚpost_versionr±   r   r   r   Úrender_pep440_preË  s   	ùüÿr¼   c                 C   s˜   | d r2| d }| d s| d r0|d| d › �7 }| d r!|d7 }|t | ƒ7 }|d| d › �7 }|S d| d › �}| d rA|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’   rP   r¶   r³   Úgr‡   ú0.postú+gr¯   r°   r   r   r   Úrender_pep440_postã  s   
ürÀ   c                 C   sÀ   | d r<| d }| d s| d r:|d| d › �7 }| d dkr#|d7 }|t | ƒ7 }|d| d	 › �7 }| d r:|d
7 }|S d| d › �}| d dkrM|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’   rP   r¶   rˆ   r�   r³   r½   r‡   r®   r¾   r¿   r¯   r°   r   r   r   Úrender_pep440_post_branchþ  s$   	úrÁ   c                 C   sh   | d r#| d }| d s| d r!|d| d › �7 }| d r!|d7 }|S d| d › �}| d r2|d7 }|S )zuTAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r‘   r’   rP   r¾   r³   r   r°   r   r   r   Úrender_pep440_old  s   ýrÂ   c                 C   sR   | d r| d }| d r|d| d › d| d › �7 }n| d }| d r'|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�   ú-gr‡   rP   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 r#|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Ã   r‡   rP   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rd}|dkr"t| ƒ}nG|dkr+t| ƒ}n>|d	kr4t| ƒ}n5|d
kr=t| ƒ}n,|dkrFt| ƒ}n#|dkrOt| ƒ}n|dkrXt| ƒ}n|dkrat| ƒ}nt	d|› d�ƒ‚|| d | d d|   d¡dœS )z9Render the given version pieces into the requested style.rQ   Úunknownr…   NrN   Údefaultr   zpep440-branchz
pep440-prezpep440-postzpep440-post-branchz
pep440-oldzgit-describezgit-describe-longzunknown style 'r�   rP   r   )
ru   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y   Y nw ztj t	¡}| j
 d¡D ]}tj |¡}q&W n tyA   ddddddœ Y S w zt| j||ƒ}t|| jƒW S  tyY   Y nw z| jrft| j||ƒW S W n	 typ   Y nw ddddddœS )z=Get version information or return default if unable to do so.ú/rt   Nz"unable to find root of source treerN   zunable to compute version)r   r   r   r   r   r    rS   rT   ÚrealpathÚ__file__r   rx   rY   Ú	NameErrorr¨   rÉ   r   r   r]   )r   r   rZ   r\   r¡   r   r   r   Úget_versionsƒ  sN   ÿÿ
ûÿ	ÿÿÿûrÎ   )NFFN)%r   r=   r—   rS   r`   r4   r2   Útypingr   r   r   r   Ú	Exceptionr    r!   Údictr8   Ú__annotations__r"   r(   rL   r]   rg   r   r¨   r¬   r²   rµ   r¹   r¼   rÀ   rÁ   rÂ   rÄ   rÅ   rÉ   rÎ   r   r   r   r   Ú<module>   sH   

.

F 
*