
    bMh}\                        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 Z	 G d d          Z
d Z G d d	e          Zi Zeeef         ed
<   i Zeeeeef         f         ed<   d Zd$dZd Z edd          d             Z edd          d             Z edd          efd            ZdefdZd Zd Zd Zd Zd Zd Zd Z d  Z!d! Z"d" Z#d# Z$dS )%z"Git implementation of _version.py.    N)Callablec                      d} d}d}| ||d}|S )z;Get the keywords needed to look up the version information.z" (HEAD, tag: v2.3.0, origin/2.3.x)(2cc37625532045f4ac55b27176454bbbc9baf213z2025-06-04 19:07:38 -0700)refnamesfulldate )git_refnamesgit_fullgit_datekeywordss       O/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pandas/_version.pyget_keywordsr      s'     8L9H*H((HMMHO    c                       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   r   c                  v    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)cfgs    r   
get_configr#   '   s@     

CCGCICN$C1CCKJr   c                       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        MMMMr   r%   LONG_VERSION_PYHANDLERSc                       fd}|S )z:Create decorator to mark a method as the handler of a VCS.c                 N    t           vr
i t           <   | t                    <   | S )z!Store f in HANDLERS[vcs][method].)r'   )fmethodvcss    r   decoratez&register_vcs_handler.<locals>.decorate@   s*    hHSM !fr   r	   )r,   r+   r-   s   `` r   register_vcs_handlerr.   =   s)          Or   Fc           	      P   t          | t                    sJ d}i }t          j        dk    r2t	          j                    }|xj        t          j        z  c_        ||d<   | D ]}	t          |	g|z             }
	 t	          j	        |	g|z   f||t          j
        |rt          j
        ndd|} n{# t          $ rX t          j                    d         }|j        t          j        k    rY |r!t          d|
            t          |           Y  dS w xY w|rt          d|             dS |                                d	                                                                         }|j        d	k    r0|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argsr2   r!   hide_stderrr3   processpopen_kwargsr1   commanddispcmder4   s                r   run_commandrS   J   s   h%%%%%GL
|w ,..z>>&1]#  wi$&''	 &	D !+6@
D   G E 	 	 	q!Aw%,&& 0w00111a:::	  	?=8==>>>z  ""1%++--4466FQ 	*47444555((()))W'''7%%%s   63B++8D%#DDc                    g }t          d          D ]}t          j                            |          }|                    |           r|t          |           d         dddddc S |                    |           t          j                            |          }|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dirnamerF   r?   r%   )r   rootr!   rootdirs_ra   s         r   versions_from_parentdirre   x   s     H1XX % %'""4((.// 	"3'7#8#8#:#:;#'     	wt$$ 
=X = =*:= =	
 	
 	
 E
F
FFr   r   r   c                    i }	 t          | d          5 }|D ]}|                                                    d          r/t          j        d|          }|r|                    d          |d<   |                                                    d          r/t          j        d|          }|r|                    d          |d<   |                                                    d	          r/t          j        d|          }|r|                    d          |d
<   	 ddd           n# 1 swxY w Y   n# t          $ r Y nw xY w|S )z0Extract version information from the given file.zutf-8)encodingzgit_refnames =z
=\s*"(.*)"r6   r   z
git_full =r   z
git_date =r   N)openrH   r^   researchgrouprB   )versionfile_absr   fobjlinemos        r   git_get_keywordsrp      s    H/G444 	7 7 7::<<**+;<< ;=$77B ;/1xx{{,::<<**<88 7=$77B 7+-88A;;(::<<**<88 7=$77B 7+-88A;;(7	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7    Os5   D8 D
D, D8 ,D00D8 3D04D8 8
EEr   c                 z  	 d| vrt          d          |                     d          }|X|                                d         }|                                                    ddd                              dd	d          }| d                                         }|                    d
          r |rt          d           t          d          d |                    d                              d          D             }d		fd|D             }|s7d |D             }|r)t          dd                    ||z
             d           |r2t          dd                    t          |                                t          |          D ]z}|                    |          rc|t          |          d         }t          j        d|          sD|rt          d|            || d                                         dd|dc S {|rt          d           d| d                                         ddddS )z*Get version information from git keywords.r   zShort version file foundr   N Tr6    z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballc                 6    h | ]}|                                 S r	   )rH   .0rs     r   	<setcomp>z-git_versions_from_keywords.<locals>.<setcomp>   s     ???!AGGII???r   z(),ztag: c                 h    h | ].}|                               |t                    d          /S )N)r^   r_   )rx   ry   TAGs     r   rz   z-git_versions_from_keywords.<locals>.<setcomp>   s8    ===a1<<+<+<=Ac#hhjjM===r   c                 <    h | ]}t          j        d |          |S )\d)ri   rj   rw   s     r   rz   z-git_versions_from_keywords.<locals>.<setcomp>   s)    777a29UA#6#67777r   zdiscarding 'z', no digitszlikely tags: r   zpicking r   FrV   z2no suitable tags, using unknown + full revision id	0+unknownzno suitable tags)r%   get
splitlinesrH   replacer^   rF   splitjoinsortedr_   ri   match)
r   r   r!   r   r   refstagsrefry   r}   s
            @r   git_versions_from_keywordsr      s    !!6777<<D   $ zz||##Ca0088b!DD
#))++H9%% N 	86777LMMM??x~~d3399#>>???D C====4===D 
F 874777 	FD$+!6!6DDDEEE 86chhvd||4466777d||  >>*%% 	C
OO%%&A 8E1%%  &nnn%%%#+F#3#9#9#;#;    	"  DBCCC#F+1133#  r   pieces_from_vcsc                    dg}t           j        dk    rddg}t          j                                        }|                    dd           t          j        ||          } ||dd	g|| 
          \  }}|dk    r$|rt          d| d           t          d           ||dddddd|  dg|          \  }}|t          d          |
                                } ||ddg|          \  }	}|	t          d          |	
                                }	i }
|	|
d<   |	dd         |
d<   d|
d<    ||g d|          \  }}|dk    s|t          d          |
                                }|dk    r~ ||d d!g|          \  }}|dk    s|t          d"          |                    d#          }d$|d         v r|                    d           d% |D             }d&|v rd&}n|sd}n|d         }||
d <   |}|                    d'          }||
d(<   |r|d|                    d'                   }d)|v rt          j        d*|          }|sd+| d,|
d<   |
S |                    d-          }|                    |           s&|rd.}t          ||| fz             d/| d0|  d,|
d<   |
S |t%          |           d         |
d1<   t'          |                    d2                    |
d3<   |                    d4          |
d<   n<d|
d1<    ||g d5|          \  }}t%          |                                          |
d3<    ||g d6|          d         
                                }|                                d7         }|
                                                    d8d9d-                              d8d: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   r0   zgit.cmdzgit.exeGIT_DIRN)r3   	rev-parsez	--git-dir)r2   rM   r   z
Directory z not under git controlz('git rev-parse --git-dir' returned errordescribez--tagsz--dirtyz--alwaysz--longz--matchz[[:digit:]]*)r2   z'git describe' failedHEADz'git rev-parse' failedlong   shortrY   )r   z--abbrev-refr   z+'git rev-parse --abbrev-ref' returned errorbranchz
--containsz&'git branch --contains' returned error
(c                 "    g | ]}|d d         S )   Nr	   )rx   r   s     r   
<listcomp>z'git_pieces_from_vcs.<locals>.<listcomp>D  s     6666F122J666r   master-dirtyrX   -z^(.+)-(\d+)-g([0-9a-f]+)$z&unable to parse git-describe output: ''r6   z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix 'closest-tagr   distancerU   )zrev-listr   z--left-right)showz-sz--format=%cir   rr   rs   rt   ru   r   )r9   r:   r[   environcopypop	functoolspartialrF   r%   rH   r   endswithrindexri   rj   rk   r^   r_   intr   r   )r   rb   r!   runnerGITSr3   rd   rcdescribe_outfull_outpiecesbranch_namebranchesgit_describerX   ro   full_tagfmtoutr   s                       r   git_pieces_from_vcsr      s    7D
|w9%
 *//

CGGItv3///FF4+{3w;WWWEAr	Qww 	=;t;;;<<<FGGG v'''	
   L" 3444%%''L6$f 54@@@LHb4555~~HFF6NrrlF7OF7OfT#H#H#HdSSSOK	Qww+%IJJJ##%%Kf vdX|$<$GGG"77h& HIII>>$'' (1+LLOOO 76X666x"KK 	&KK #1+K"F8  L !!(++EF7O E#$Cl&9&9(&C&C$CD lY3\BB 	V|VVVF7OM 88A;;"":.. 	 4?cXz22333 MLLzLLL  M (Z):): ;} !!--z ((1++w !%}&CCCNNNR --z 6$>>>DIII!LRRTTD ??R DZZ\\))#sA66>>sBJJF6NMr   returnc                 :    d|                      dd          v rdS dS )z8Return a + if we don't already have one, else return a .+r   ru   .)r   )r   s    r   plus_or_dotr     s%    
fjj++++s3r   c                     | d         rN| d         }| d         s| d         r5|t          |           z  }|| d          d| d          z  }| d         r|dz  }n!d| d          d| d          }| d         r|dz  }|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   rX   .gr   .dirtyz0+untagged.r   r   rendereds     r   render_pep440r     s     m !-(* 	% 	%F+++H6*-BBBBBHg %H$ I
!3HHvgHH'? 	! HOr   c                 B   | d         r_| d         }| d         s| d         rF| d         dk    r|dz  }|t          |           z  }|| d          d| d          z  }| d         r|d	z  }n7d
}| d         dk    r|dz  }|d| d          d| d          z  }| d         r|d	z  }|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   rX   r   r   .dev0r   r   r   0z
+untagged.r   r   s     r   render_pep440_branchr     s     m !-(* 	% 	%h8++G#F+++H6*-BBBBBHg %H$ (x''HH
!3HHvgHHH'? 	! HOr   c                     t                               | d          }|d         t          |          dk    rt          |d         pd          n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   r6   N)r?   r   r_   r   )vervcs     r   pep440_split_postr     sF     
3	 	 Ba5SWW\\#bejq///t;;r   c                     | d         rQ| d         r@t          | d                   \  }}|}||d|dz    d| d          z  }n#|d| d          z  }n| d         }nd| d          }|S )	z_TAG[.postN.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post0.devDISTANCE
    r   r   Nr   r6   z.devz
.post0.devz0.post0.dev)r   )r   tag_versionpost_versionr   s       r   render_pep440_prer     s     m 6* 
	-(9&:O(P(P%K"H'NL1$4NN&:LNNN=
);=== m,HH 6
!355Or   c                 
   | d         rT| d         }| d         s| d         r;|d| d          z  }| d         r|dz  }|t          |           z  }|d| d          z  }n&d| d          }| d         r|dz  }|d	| d          z  }|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   rX   r   r   gr   0.post+gr   r   s     r   render_pep440_postr     s     m +-(* 	. 	.4z 2444Hg $G#F+++H-F7O---H 1F:.00'? 	 H****Or   c                 N   | d         re| d         }| d         s| d         rL|d| d          z  }| d         dk    r|dz  }|t          |           z  }|d| d	          z  }| d         r|d
z  }n7d| d          }| d         dk    r|dz  }|d| d	          z  }| d         r|d
z  }|S )zTAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .

    The ".dev0" means not master branch.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty]
    r   r   rX   r   r   r   r   r   r   r   r   r   r   r   s     r   render_pep440_post_branchr     s    m !-(* 	% 	%4z 2444Hh8++G#F+++H-F7O---Hg %H$ 1F:.00(x''H****'? 	! HOr   c                     | d         r4| d         }| d         s| d         r|d| d          z  }| d         r|dz  }nd| d          }| d         r|dz  }|S )zuTAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r   r   rX   r   r   r	   r   s     r   render_pep440_oldr     s     m 
 -(* 	$ 	$5
!3555Hg $G# 1F:.00'? 	 HOr   c                     | d         r(| d         }| d         r|d| d          d| d          z  }n| d         }| d         r|dz  }|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   rX   r   r	   r   s     r   render_git_describer   1  st     m #-(* 	DCF:.CC&/CCCH '?g HOr   c                     | d         r | d         }|d| d          d| d          z  }n| d         }| d         r|dz  }|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   rX   r   r	   r   s     r   render_git_describe_longr   E  sg     m #-(?z*??fWo??? '?g HOr   c                 <   | d         r!d|                      d          d| d         ddS |r|dk    rd}|dk    rt          |           }n|dk    rt          |           }n|d	k    rt          |           }n|d
k    rt	          |           }nk|dk    rt          |           }nU|dk    rt          |           }n?|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.rY   unknownr   NrV   defaultr   zpep440-branchz
pep440-prezpep440-postzpep440-post-branchz
pep440-oldzgit-describezgit-describe-longzunknown style 'r   rX   r   )
r   r   r   r   r   r   r   r   r   
ValueError)r   r   r   s      r   renderr   Y  su   g 
 %zz&11G_
 
 	
  EY&& ((	/	!	!'//	,		$V,,	-		%f--	&	&	&,V44	,		$V,,	.	 	 &v..	%	%	%+F3335333444 !&>

6""  r   c                  l   t                      } | j        }	 t          t                      | j        |          S # t
          $ r Y nw xY w	 t          j                            t                    }| j
                            d          D ]!}t          j                            |          }"n# t          $ r ddddddcY S w xY w	 t          | j        ||          }t          || j                  S # t
          $ r Y nw xY w	 | j        rt%          | j        ||          S n# t
          $ r Y nw xY wddddddS )z=Get version information or return default if unable to do so./r   Nz"unable to find root of source treerV   zunable to compute version)r#   r!   r   r   r   r%   r[   r\   realpath__file__r    r   ra   	NameErrorr   r   r   r   re   )r"   r!   rb   rd   r   s        r   get_versionsr     s    ,,CkG),..#.'RRR   
w)) '--c22 	) 	)A7??4((DD	) 
 
 
"#9
 
 	
 	
 	

$S^T7CCfci(((    	P*3+?wOOO	P    ,  sF   !9 
AA
A B+ +C ?C *C/ /
C<;C< D 
D+*D+)NFFN)%r   rD   r   r[   ri   r;   r9   typingr   r   r   r#   	Exceptionr%   r&   dictr?   __annotations__r'   r.   rS   re   rp   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   <module>r      s   ) ( (      				 				     



      
 
 
= = = = = = = =  N N N N NI N N N #%c3h $ $ $+-$sDh''
( - - -
 
 
+& +& +& +&\G G G< e^,,  -,6 eZ((C C )(CL e.//:E H H H 0/HV3      0  :< < <  0  6  :  ,  (  (' ' 'T1 1 1 1 1r   