i\UdZddlmZddlZddlZddlZddlZddlZddlZdZ GddZ dZ Gdd e Z iZeeefed <iZeeeeeffed <d Zd$dZdZedddZedddZeddefdZdefdZdZdZdZdZdZdZdZ d Z!d!Z"d"Z#defd#Z$dS)%z"Git implementation of _version.py.)CallableNcd}d}d}|||d}|S)z;Get the keywords needed to look up the version information.z" (HEAD, tag: v3.0.2, origin/3.0.x)(ab90747e3dae0e69b1bdbf083820b8075689b34bz2026-03-30 21:34:07 +0200)refnamesfulldate) git_refnamesgit_fullgit_datekeywordss =C:\PYTHON\_runtimes\venv\Lib\site-packages\pandas/_version.py get_keywordsrs' 8L9H*H((HMMH OceZdZdZdS)VersioneerConfigz2Container for Versioneer configuration parameters.N__name__ __module__ __qualname____doc__r rrrr#s<<<.decorate@s* h  HSM ! frr )r,r+r-s`` rregister_vcs_handlerr.=s) OrFc Lt|tsJd}i}tjdkr2t j}|xjtjzc_||d<|D]} t| g|} t j | g|f||tj |r tj ndd|}n{#t$rXtj d} | j tjkrY|r!td| t| YdSwxYw|rtd|dS|d } |jd kr0|r%td| d td | d|jfS| |jfS) zCall the given command(s).Nwin32 startupinfo)cwdenvstdoutstderrzunable to run )NNzunable to find command, tried rz (error)z stdout was ) isinstancelistsysplatform subprocess STARTUPINFOdwFlagsSTARTF_USESHOWWINDOWstrPopenPIPEOSErrorexc_infoerrnoENOENTprint communicatestripdecode returncode) commandsargsr2r! hide_stderrr3process popen_kwargsr1commanddispcmder4s r run_commandrSJs h % %%% %GL |w ,.. z>>&1 ]#w&&''  & 4 !+6@ D   G E    q!Aw%,&& 0w00111a:::   ? =8== > > >z  " "1 % + + - - 4 4 6 6FQ  * 47444 5 5 5 ((( ) ) )W''' 7% %%s52B))8D ##D  D cg}tdD]}tj|}||r|t |ddddddcS||tj|}|rtd|d|td)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 NFversionzfull-revisioniddirtyerrorrzTried directories z* but none started with prefix z+rootdir doesn't start with parentdir_prefix) rangeospathbasename startswithlenappenddirnamerFr%)rrootr!rootdirs_ras rversions_from_parentdirrexsH 1XX % %'""4((   . / / "3'7#8#8#:#:;#'     wt$$   = = =*: = =    E F FFrrrci} t|d5}|D]}|dr/tjd|}|r|d|d<|dr/tjd|}|r|d|d<|d r/tjd|}|r|d|d < d d d n #1swxYwYn#t $rYnwxYw|S) z0Extract version information from the given file.zutf-8)encodingzgit_refnames =z =\s*"(.*)"r6rz git_full =rz git_date =rN)openrHr^researchgrouprB)versionfile_absr fobjlinemos rgit_get_keywordsrpsH /G 4 4 4 7 7 7::<<**+;<<;=$77B;/1xx{{,::<<**<887=$77B7+-88A;;(::<<**<887=$77B7+-88A;;( 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7      Os5D8D D, D8,D00D83D04D88 EEr cz d|vrtd|d}|X|d}|ddddd d}|d}|d r |rt d td d |ddD}d fd|D}|s7d|D}|r)t dd||z d|r2t ddt|t|D]z}||rc|t|d}tj d|sD|rt d|||ddd|dcS{|rt dd|dddddS)z*Get version information from git keywords.rzShort version file foundrN Tr6z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballc6h|]}|Sr )rH.0rs r z-git_versions_from_keywords..s ? ? ?!AGGII ? ? ?rz(),ztag: chh|].}||td/S)N)r^r_)rxryTAGs rrzz-git_versions_from_keywords..s8 = = =a1<<+<+< =Ac#hhjjM = = =rc<h|]}tjd||S)\d)rirjrws rrzz-git_versions_from_keywords..s)777a29UA#6#67777rz discarding 'z ', no digitsz likely tags: rzpicking rFrVz2no suitable tags, using unknown + full revision id 0+unknownzno suitable tags) r%get splitlinesrHreplacer^rFsplitjoinsortedr_rimatch) r rr!rrrefstagsrefryr}s @rgit_versions_from_keywordsrs!!6777 <<  D   $zz||##Ca0088b!DD #))++H9%%N  8 6 7 7 7LMMM ? ?x~~d3399#>> ? ? ?D C = = = =4 = = =D  F874777  F D$+!6!6DDD E E E8 6chhvd||4466777d|| >>* % % C OO%%&A8E1%%  &nnn%%%#+F#3#9#9#;#;     "D BCCC#F+1133#   rpieces_from_vcsc dg}tjdkrddg}tj}|ddt j||}||dd g|| \}}|d kr$|rtd |d td||dddddd|dg|\}}|td| }||ddg|\} }| td| } i} | | d<| dd| d<d| d<||gd|\} }|d ks| td| } | dkr~||d d!g|\} }|d ks| td"| d#} d$| d vr| d d%| D} d&| vrd&} n | sd} n| d } | | d <|} | d'}|| d(<|r| d| d'} d)| vrtjd*| }|s d+|d,| d<| S|d-}||s&|rd.}t|||fzd/|d0|d,| d<| S|t%|d| d1<t'|d2| d3<|d4| d<nz'git_pieces_from_vcs..Ds 6666F122J666rmaster-dirtyrX-z^(.+)-(\d+)-g([0-9a-f]+)$z&unable to parse git-describe output: ''r6z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix ' closest-tagrdistancerU)zrev-listrz --left-right)showz-sz --format=%cirrrrsrtrur)r9r:r[environcopypop functoolspartialrFr%rHrendswithrindexrirjrkr^r_intrr)rrbr!runnerGITSr3rdrc describe_outfull_outpieces branch_namebranches git_describerXrofull_tagfmtoutrs rgit_pieces_from_vcsrs 7D |w9% *//  CGGIt  v3 / / /F F4+{3w; W W WEAr Qww  = ;t;;; < < <FGGGv       ' ' '     L"3444%%''L6$f 54@@@LHb4555~~H FF6NrrlF7OF7OfT#H#H#HdSSSOK Qww+%IJJJ##%%KfvdX|$<$GGG " 77h& HII I>>$'' (1+   LLOOO76X666 x  "KK &KK#1+K"F8 L  ! !( + +EF7O E#$Cl&9&9(&C&C$CD  l Y3\ B B V|VVVF7OM88A;;"":..  4?cXz22333LLLzLLL 7OM (Z):): ;}!!--z((1++w!%}&CCCNNNR --z 6$>>>D I I I! L R R T TD ??  R DZZ\\))#sA66>>sBJJF6N Mrreturnc:d|ddvrdSdS)z8Return a + if we don't already have one, else return a .+rru.)r)rs r plus_or_dotrs% fjj++++s 3rc|drN|d}|ds|dr5|t|z }||dd|dz }|dr|dz }n!d|dd|d}|dr|dz }|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] rrrX.gr.dirtyz 0+untagged.rrrendereds r render_pep440rsm !-( *  % %  F++ +H 6*-BBBB BHg %H$I !3HHvgHH '? !  H OrcB|dr_|d}|ds|drF|ddkr|dz }|t|z }||dd|dz }|dr|d z }n7d }|ddkr|dz }|d |dd|dz }|dr|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] rrrXrr.dev0rrr0z +untagged.rrs rrender_pep440_branchrsm!-( *  % %h8++G#  F++ +H 6*-BBBB BHg %H$ ( x ' '  HH !3HHvgHHH '? !  H Orct|d}|dt|dkrt|dpdndfS)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). .postrrr6N)r?rr_r)vervcs rpep440_split_postrsF 3 B a5SWW\\#bejq///t ;;rc|drQ|dr@t|d\}}|}||d|dzd|dz }n#|d|dz }n|d}n d|d}|S) z_TAG[.postN.devDISTANCE] -- No -dirty. Exceptions: 1: no tags. 0.post0.devDISTANCE rrNrr6z.devz .post0.devz 0.post0.dev)r)r tag_version post_versionrs rrender_pep440_prers m6 *  -(9&:O(P(P %K"H'NL1$4NN&:LNNN= );===m,HH6 !355 Orc |drT|d}|ds|dr;|d|dz }|dr|dz }|t|z }|d|dz }n&d|d}|dr|dz }|d |dz }|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] rrrXrrgr0.post+grrs rrender_pep440_postrsm +-( *  . . 4z 244 4Hg $G#  F++ +H -F7O-- -H1F:.00 '?  H**** OrcN|dre|d}|ds|drL|d|dz }|ddkr|dz }|t|z }|d|d z }|dr|d z }n7d |d}|ddkr|dz }|d |d z }|dr|d z }|S) zTAG[.postDISTANCE[.dev0]+gHEX[.dirty]] . The ".dev0" means not master branch. Exceptions: 1: no tags. 0.postDISTANCE[.dev0]+gHEX[.dirty] rrrXrrrrrrrrrrrs rrender_pep440_post_branchrsm!-( *  % % 4z 244 4Hh8++G#  F++ +H -F7O-- -Hg %H$1F:.00 ( x ' '  H**** '? !  H Orc|dr4|d}|ds|dr|d|dz }|dr|dz }nd|d}|dr|dz }|S)zuTAG[.postDISTANCE[.dev0]] . The ".dev0" means dirty. Exceptions: 1: no tags. 0.postDISTANCE[.dev0] rrrXrrr rs rrender_pep440_oldrsm  -( *  $ $ 5 !355 5Hg $G#1F:.00 '?  H Orc|dr(|d}|dr|d|dd|dz }n|d}|dr|dz }|S)zTAG[-DISTANCE-gHEX][-dirty]. Like 'git describe --tags --dirty --always'. Exceptions: 1: no tags. HEX[-dirty] (note: no 'g' prefix) rrr-grrXrr rs rrender_git_describer1stm#-( *  D CF:.CC&/CC CH'? gH Orc|dr |d}|d|dd|dz }n|d}|dr|dz }|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) rrrrrrXrr rs rrender_git_describe_longrEsgm#-(?z*??fWo???'? gH Orc<|dr!d|dd|dddS|r|dkrd}|dkrt|}n|dkrt|}n|d krt|}n|d krt |}nk|d krt |}nU|d krt |}n?|d krt|}n)|dkrt|}ntd|d||d|dd|ddS)z9Render the given version pieces into the requested style.rYunknownrNrVdefaultrz pep440-branchz pep440-prez pep440-postzpep440-post-branchz pep440-oldz git-describezgit-describe-longzunknown style 'rrXr) rrrrrrrrr ValueError)rrrs rrenderrYsu g  %zz&11G_     EY&&  (( / ! !'// ,  $V,, -  %f-- & & &,V44 ,  $V,, . &v.. % % %+F3335333444!&> 6""   rclt}|j} tt|j|S#t $rYnwxYw t jt}|j dD]!}t j |}"n#t$r ddddddcYSwxYw t|j||}t||jS#t $rYnwxYw |jrt%|j||Sn#t $rYnwxYwddddddS)z=Get version information or return default if unable to do so./rNz"unable to find root of source treerVzunable to compute version)r#r!rrrr%r[r\realpath__file__r rra NameErrorrrrrre)r"r!rbrdrs r get_versionsrs ,,CkG ),..#.'RRR       w))'--c22 ) )A7??4((DD )    "#9        $S^T7CCfci(((         P*3+?wOO O P      ,   sF!9 AA A B++C?C*C// C<;C<D D+*D+)NFFN)%rcollections.abcrrDrr[rir;r9rrr# Exceptionr%r&dictr?__annotations__r'r.rSrerprrrrrrrrrrrrrrr rrrs)(($$$$$$      ========   NNNNNINNN#%c3h$$$+-$sDh'' (---   +&+&+&+&\GGG<e^,,-,6eZ((CC)(CLe.//:EHHH0/HV30:<<<06:,(('''T1d111111r