o
    vh}\                     @   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" (HEAD, tag: v2.3.1, origin/2.3.x)(c888af6d0bb674932007623c0867e1fbd4bdc2c6z2025-07-07 19:27:57 +0200)refnamesfulldate )git_refnamesgit_fullgit_datekeywordsr   r   M/var/www/html/hyperkenya/venv/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|rt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   
	


rM   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@   r9   r!   )r   rootr   rootdirs_rZ   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*"(.*)"r0   r   z
git_full =r   z
git_date =r   N)openrB   rW   researchgroupr<   )versionfile_absr   fobjlinemor   r   r   git_get_keywords   s4   rh   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|sq||rtd|  || d  dd|d  S q||rtd d| d  ddddS )z*Get version information from git keywords.r   zShort version file foundr   N Tr0    z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballc                 S   s   h | ]}|  qS r   )rB   .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)rW   rX   rm   TAGr   r   rp      s   & c                 S   s   h | ]
}t d |r|qS )\d)ra   rb   rm   r   r   r   rp      s    zdiscarding 'z', no digitszlikely tags: rt   zpicking r   FrO   z2no suitable tags, using unknown + full revision id	0+unknownzno suitable tags)r!   get
splitlinesrB   replacerW   r@   splitjoinsortedrX   ra   match)	r   r   r   r   r   refstagsrefro   r   rr   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 rt	d|
 }|dkr||d d!g|d\}}|dks|du rt	d"|d#}d$|d v r|d d%d& |D }d'|v rd'}n	|sd}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,   rG   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   shortrR   )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   )rn   r   r   r   r   
<listcomp>D  s    z'git_pieces_from_vcs.<locals>.<listcomp>master-dirtyrQ   -z^(.+)-(\d+)-g([0-9a-f]+)$z&unable to parse git-describe output: ''r0   z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix 'closest-tagr   distancerN   )zrev-listr   z--left-right)showz-sz--format=%cir   ri   rj   rk   rl   r   )r3   r4   rT   environcopypop	functoolspartialr@   r!   rB   ry   endswithrindexra   rb   rc   rW   rX   intrw   rx   )r   r[   r   runnerGITSr-   r]   rcdescribe_outfull_outpiecesbranch_namebranchesgit_describerQ   rg   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   rl   .)rv   )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   rQ   .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 )zTAG[[.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   rQ   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 )zSplit 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   r0   N)r9   ry   rX   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   r0   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   rQ   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 )zTAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .

    The ".dev0" means not master branch.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty]
    r   r   rQ   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   rQ   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 )zTAG[-DISTANCE-gHEX][-dirty].

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

    Exceptions:
    1: no tags. HEX[-dirty]  (note: no 'g' prefix)
    r   r   r   -gr   rQ   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 )zTAG-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   rQ   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.rR   unknownr   NrO   defaultr   zpep440-branchz
pep440-prezpep440-postzpep440-post-branchz
pep440-oldzgit-describezgit-describe-longzunknown style 'r   rQ   r   )
rv   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./ru   Nz"unable to find root of source treerO   zunable to compute version)r    r   r   r   r   r!   rT   rU   realpath__file__r   ry   rZ   	NameErrorr   r   r   r   r^   )r   r   r[   r]   r   r   r   r   get_versions  sN   
	r   )NFFN)%r   r>   r   rT   ra   r5   r3   typingr   r   r   r    	Exceptionr!   r"   dictr9   __annotations__r#   r)   rM   r^   rh   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>   sH   

.

F 
*