
    Owg<\                     v   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$y)$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$Format:%d$z$Format:%H$z$Format:%ci$)refnamesfulldate )git_refnamesgit_fullgit_datekeywordss       F/var/www/horilla/myenv/lib/python3.12/site-packages/pandas/_version.pyget_keywordsr      s$     !LHH((HMHO    c                       e Zd ZdZy)VersioneerConfigz2Container for Versioneer configuration parameters.N__name__
__module____qualname____doc__r   r   r   r   r   #   s    <r   r   c                  n    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y)NotThisMethodzCException raised if a method is not valid for the current scenario.Nr   r   r   r   r$   r$   5   s    Mr   r$   LONG_VERSION_PYHANDLERSc                       fd}|S )z:Create decorator to mark a method as the handler of a VCS.c                 B    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   c           	      R   t        | t              sJ d}i }t        j                  dk(  r<t	        j
                         }|xj                  t        j                  z  c_        ||d<   | D ]R  }	t        |	g|z         }
	 t	        j                  |	g|z   f||t        j                  |rt        j                  ndd|} n |rt        d|         y|j!                         d	   j#                         j%                         }|j&                  d	k7  r-|rt        d|
 d
       t        d|        d|j&                  fS ||j&                  fS # t        $ rV t        j                         d   }|j                  t        j                  k(  rY |rt        d|
        t        |       Y  yw xY w)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argsr1   r    hide_stderrr2   processpopen_kwargsr0   commanddispcmder3   s                r   run_commandrR   J   s   h%%%GL
||w ,,.z>>>&1]# wi$&'	 &&	D !+6
D G , 28*=>  "1%++-446FQN7)845Kx()W''''7%%%%%  	q!Aww%,,&wi01a	s   ;?E=F&F&%F&c                 `   g }t        d      D ]x  }t        j                  j                  |      }|j	                  |       r|t        |       d dddddc S |j                  |       t        j                  j                  |      }z |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dirnamerE   r>   r$   )r   rootr    rootdirs_r`   s         r   versions_from_parentdirrd   x   s     H1X %''""4(./"3'7#8#:;#'  	wwt$%  X 0**:);=	
 E
FFr   r   r   c                 H   i }	 t        | d      5 }|D ]  }|j                         j                  d      r,t        j                  d|      }|r|j                  d      |d<   |j                         j                  d      r,t        j                  d|      }|r|j                  d      |d<   |j                         j                  d	      st        j                  d|      }|s|j                  d      |d
<    	 ddd       |S # 1 sw Y   |S xY w# t        $ r Y |S w xY w)z0Extract version information from the given file.zutf-8)encodingzgit_refnames =z
=\s*"(.*)"r5   r   z
git_full =r   z
git_date =r   N)openrG   r]   researchgrouprA   )versionfile_absr   fobjlinemos        r   git_get_keywordsro      s    H/G4 	7 7::<**+;<=$7B/1xx{,::<**<8=$7B+-88A;(::<**<8=$7B+-88A;(7	7  O!	7  O  Os;   D B;DD&D=D DD D 	D! D!r   c                 N   d| vrt        d      | j                  d      }|E|j                         d   }|j                         j	                  ddd      j	                  dd	d      }| d   j                         }|j                  d
      r|rt        d       t        d      |j                  d      j                  d      D ch c]  }|j                          }}d}|D ch c]"  }|j                  |      s|t        |      d $ }}|sI|D ch c]  }t        j                  d|      s| }}|r!t        ddj                  ||z
         d       |r&t        ddj                  t        |                    t        |      D ]c  }	|	j                  |      s|	t        |      d }t        j                  d|      s:|rt        d|        || d   j                         dd|dc S  |rt        d       d| d   j                         ddddS c c}w c c}w c c}w )z*Get version information from git keywords.r   zShort version file foundr   N Tr5    z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballz(),ztag: z\dzdiscarding 'z', no digitszlikely tags: zpicking r   FrU   z2no suitable tags, using unknown + full revision id	0+unknownzno suitable tags)r$   get
splitlinesrG   replacer]   rE   splitr^   rh   ri   joinsortedmatch)
r   r   r    r   r   rrefsTAGtagsrefs
             r   git_versions_from_keywordsr      s'    !677<<D  $ zz|##Ca088b!D
#))+H9%67LMM'~~d399#>?!AGGI?D? C#'=a1<<+<Ac#hjM=D=  7a299UA#677L$+!6 7|DEchhvd|4567d| >>*%C
O%&A 88E1%n%#+F#3#9#9#; & BC#F+113# O @ > 8s   H%H<HH"0H"pieces_from_vcsc                 ^   dg}t         j                  dk(  rddg}t        j                  j	                         }|j                  dd       t        j                  ||      } ||dd	g|| 
      \  }}|dk7  r|rt        d| d       t        d       ||dddddd|  dg|      \  }}|t        d      |j                         } ||ddg|      \  }	}|	t        d      |	j                         }	i }
|	|
d<   |	dd |
d<   d|
d<    ||g d|      \  }}|dk7  s|t        d      |j                         }|dk(  rn ||d d!g|      \  }}|dk7  s|t        d"      |j                  d#      }d$|d   v r|j                  d       |D cg c]  }|d%d 	 }}d&|v rd&}n
|sd}n|d   }||
d <   |}|j                  d'      }||
d(<   |r|d|j                  d'       }d)|v rt        j                  d*|      }|sd+| d,|
d<   |
S |j!                  d-      }|j#                  |       s"|rd.}t        ||| fz         d/| d0|  d,|
d<   |
S |t%        |       d |
d1<   t'        |j!                  d%            |
d2<   |j!                  d3      |
d<   n1d|
d1<    ||g d4|      \  }}t%        |j                               |
d2<    ||g d5|      d   j                         }|j)                         d6   }|j                         j+                  d7d8d-      j+                  d7d9d-      |
d:<   |
S c c}w );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)r2   	rev-parsez	--git-dir)r1   rL   r   z
Directory z not under git controlz('git rev-parse --git-dir' returned errordescribez--tagsz--dirtyz--alwaysz--longz--matchz[[:digit:]]*)r1   z'git describe' failedHEADz'git rev-parse' failedlong   shortrX   )r   z--abbrev-refr   z+'git rev-parse --abbrev-ref' returned errorbranchz
--containsz&'git branch --contains' returned error
(   master-dirtyrW   -z^(.+)-(\d+)-g([0-9a-f]+)$z&unable to parse git-describe output: ''r5   z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix 'closest-tagdistancerT   )zrev-listr   z--left-right)showz-sz--format=%cir   rq   rr   rs   rt   r   )r8   r9   rZ   environcopypop	functoolspartialrE   r$   rG   rz   endswithrindexrh   ri   rj   r]   r^   intrx   ry   )r   ra   r    runnerGITSr2   rc   rcdescribe_outfull_outpiecesbranch_namebranchesr   git_describerW   rn   full_tagfmtoutr   s                        r   git_pieces_from_vcsr      s    7D
||w9%
 **//
CGGItv3/F4+{3w;WEAr	QwJtf$:;<FGG l,'	
 L" 344%%'L$f 54@LHb455~~HFF6NrlF7OF7OT#HdSOK	Qw+%IJJ##%Kf dX|$<$G"7h& HII>>$' (1+LLO .666F12J66x"KK #1+K"F8  L !!(+EF7O#$Cl&9&9(&CD lYY3\B F|nTUVF7OM 88A;"":.?cXz223 z!>zl!L  M (Z): ;} !!-z ((1+w !%}CNR -z $>DI!LRRTD ??R DZZ\))#sA6>>sBJF6NM} 7s   L*returnc                 .    d| j                  dd      v ryy)z8Return a + if we don't already have one, else return a .+r   rt   .)rw   )r   s    r   plus_or_dotr     s    
fjj++r   c                     | d   r9| d   }| d   s| d   r(|t        |       z  }|| d    d| d    z  }| d   r|dz  }|S 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   rW   .gr   .dirtyz0+untagged.r   r   rendereds     r   render_pep440r     s     m-(*F++H6*-.b0ABBHgH$ O !
!3 4Bvg6GH'? HOr   c                     | d   rF| d   }| d   s| d   r5| d   dk7  r|dz  }|t        |       z  }|| d    d| d    z  }| d   r|d	z  }|S d
}| d   dk7  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   rW   r   r   .dev0r   r   r   0z
+untagged.r   r   s     r   render_pep440_branchr     s     m-(*h8+G#F++H6*-.b0ABBHgH$ O (x'Hj
!3 4Bvg6GHH'? HOr   c                 ~    t         j                  | d      }|d   t        |      dk(  rt        |d   xs 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   r5   N)r>   rz   r^   r   )vervcs     r   pep440_split_postr     sA     
3	 Ba5SW\#bejq/;;t;;r   c                     | d   rA| d   r5t        | d         \  }}|}||d|dz    d| d    z  }|S |d| d    z  }|S | d   }|S d| d    }|S )z_TAG[.postN.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post0.devDISTANCE
    r   r   r   r5   z.devz
.post0.devz0.post0.dev)r   )r   tag_versionpost_versionr   s       r   render_pep440_prer     s     m*(9&:O(P%K"H'eL1$4#5T&:L9MNN O j
);(<== O	 m,H O !
!3 45Or   c                     | d   r?| d   }| d   s| d   r.|d| d    z  }| d   r|dz  }|t        |       z  }|d| d    z  }|S 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   rW   r   r   gr   0.post+gr   r   s     r   render_pep440_postr     s     m-(*%z 2344HgG#F++H!F7O,--H O	 F:./0'?Hb)**Or   c                     | d   rL| d   }| d   s| d   r;|d| d    z  }| d   dk7  r|dz  }|t        |       z  }|d| d	    z  }| d   r|d
z  }|S d| d    }| d   dk7  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   rW   r   r   r   r   r   r   r   r   r   r   r   s     r   render_pep440_post_branchr     s     m-(*%z 2344Hh8+G#F++H!F7O,--HgH$ O F:./0(x'Hb)**'? HOr   c                     | d   r&| d   }| d   s| d   r|d| d    z  }| d   r|dz  }|S d| d    }| d   r|dz  }|S )zuTAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Exceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r   r   rW   r   r   r   r   s     r   render_pep440_oldr     s}     m-(*&
!3 455HgG# O F:./0'?HOr   c                 f    | 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   rW   r   r   r   s     r   render_git_describer   1  sa     m-(*!F:./r&/1B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   rW   r   r   r   s     r   render_git_describe_longr   E  sY     m-(az*+2fWo->?? '?gHOr   c                    | d   rd| j                  d      d| d   ddS |r|dk(  rd}|dk(  rt        |       }n|dk(  rt        |       }nu|d	k(  rt        |       }nd|d
k(  rt	        |       }nS|dk(  rt        |       }nB|dk(  rt        |       }n1|dk(  rt        |       }n |dk(  rt        |       }nt        d| d      || d   | d   d| j                  d      dS )z9Render the given version pieces into the requested style.rX   unknownr   NrU   defaultr   zpep440-branchz
pep440-prezpep440-postzpep440-post-branchz
pep440-oldzgit-describezgit-describe-longzunknown style 'r   rW   r   )
rw   r   r   r   r   r   r   r   r   
ValueError)r   r   r   s      r   renderr   Y  s   g %zz&1G_
 	
 EY& (	/	!'/	,	$V,	-	%f-	&	&,V4	,	$V,	.	 &v.	%	%+F3?5'344 !&>

6" r   c                  t   t               } | j                  }	 t        t               | j                  |      S # t
        $ r Y nw xY w	 t        j                  j                  t              }| j                  j                  d      D ]!  }t        j                  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./rv   Nz"unable to find root of source treerU   zunable to compute version)r"   r    r   r   r   r$   rZ   r[   realpath__file__r   rz   r`   	NameErrorr   r   r   r   rd   )r!   r    ra   rc   r   s        r   get_versionsr     sD    ,CkkG),.#..'RR 
ww) ''--c2 	)A77??4(D	) 
"#9
 	

$S^^T7Cfcii(( *3+?+?wOO    , sF   7 	AAA"B* *B>=B>,C/ /	C;:C;?"D# #	D/.D/)NFFN)%r   rC   r   rZ   rh   r:   r8   typingr   r   r   r"   	Exceptionr$   r%   dictr>   __annotations__r&   r-   rR   rd   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s"   )   	 	  
 
= =NI N #%c3h $+-$sDh''
( -
+&\G< e^, -6 eZ(C )CL e./:E H 0HV3 0:<06:,(('T1r   