
    ":hH                        d Z ddlZddlZddlZddlZddlZd Z G d d      Zd Z G d de	      Z
i Zi Z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 Zd Zd Zd Zd Zd Zd Zd Zd Zy)z"Git implementation of _version.py.    Nc                      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       a/var/www/html/turnos/venv/lib/python3.12/site-packages/ccxt/static_dependencies/ecdsa/_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pep440zpython-ecdsa-zecdsa-zecdsa/_version.pyF)r   VCSstyle
tag_prefixparentdir_prefixversionfile_sourceverbose)cfgs    r   
get_configr    %   s=     
CCGCI$CN#C0C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"   3   s    Mr   r"   c                       fd}|S )z?Decorator to mark a method as the handler for a particular VCS.c                 B    t         vr	i t         <   | t            <   | S )z!Store f in HANDLERS[vcs][method].)HANDLERS)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                    t        | t              sJ d}| D ]Q  }	 t        |g|z         }t        j                  |g|z   ||t        j
                  |rt        j
                  nd      } n |rt        d|        y|j                         d   j                         }
t        j                  d   dk\  r|
j                         }
|j                   dk7  r,|rt        d	|z         t        d
|
z         d|j                   fS |
|j                   fS # t        $ rV t        j                         d   }	|	j                  t        j                  k(  rY 5|rt        dz         t        |	       Y  yw xY w)zCall the given command(s).N)cwdenvstdoutstderr   zunable to run %s)NNzunable to find command, tried r      zunable to run %s (error)zstdout was %s)
isinstanceliststr
subprocessPopenPIPEEnvironmentErrorsysexc_infoerrnoENOENTprintcommunicatestripversion_infodecode
returncode)commandsargsr,   r   hide_stderrr-   pcdispcmder.   s              r   run_commandrJ   F   sQ    h%%%A 	1#*oG  !t#(2<G.25A $ BC]]_Q%%'F
a||q,w67/F*+Q\\!!1<<)   	q!Aww%,,&(723a	s   AD=E+E+*E+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
    r1   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=   r4   r"   )r   rootr   rootdirsirW   s         r   versions_from_parentdirr[   k   s     H1X )''""4(./&s+;'<'=>'+"T4A A OOD!77??4(D) 8}.0 	1
E
FFr   r   r   c                 T   i }	 t        | d      }|j                         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	<    |j                          |S # t        $ r Y |S w xY w)
z0Extract version information from the given file.rzgit_refnames =z
=\s*"(.*)"r0   r   z
git_full =r   z
git_date =r   )	open	readlinesr?   rT   researchgroupcloser8   )versionfile_absr   r&   linemos        r   git_get_keywordsrg      s    H#&KKM 	3Dzz|&&'78YY}d3+-88A;HZ(zz|&&|4YY}d3')xx{HV$zz|&&|4YY}d3')xx{HV$	3 	
	 O  Os   CD D 2&D 	D'&D'r   c           	      0   | st        d      | j                  d      }|2|j                         j                  ddd      j                  ddd      }| d   j                         }|j	                  d	      r|rt        d
       t        d      t        |j                  d      j                  d      D cg c]  }|j                          c}      }d}t        |D cg c]"  }|j	                  |      s|t        |      d $ c}      }|sRt        |D cg c]  }t        j                  d|      s| c}      }|r t        ddj                  ||z
        z         |r&t        ddj                  t        |            z         t        |      D ]L  }	|	j	                  |      s|	t        |      d }|rt        d|z         || 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.zno keywords at all, weirdr   N Tr0    r   z$Formatz"keywords are unexpanded, not usingz.unexpanded keywords, not a git-archive tarballz(),ztag: z\dzdiscarding '%s', no digitszlikely tags: %sz
picking %sr   FrL   z2no suitable tags, using unknown + full revision id	0+unknownzno suitable tags)r"   getr?   replacerT   r=   setsplitrU   r`   ra   joinsorted)
r   r   r   r   r   r]   refsTAGtagsrefs
             r   git_versions_from_keywordsrx      s    788<<D zz|##Ca088b!D
#))+H9%67LMM8>>$#7#=#=c#BCa	CDD Cd@all3.?#c()@AD t;!ryy':A;<.$+1FFG#((6$<"889d| 	">>*%C
O$%AlQ&' '/'7'='='?"T " "	" BC"'/557%7G G? D A <s   6H	H6HH4Hpieces_from_vcsc                 *   dg}t         j                  dk(  rddg} ||ddg|d      \  }}|d	k7  r|rt        d
|z         t        d       ||ddddddd| z  g|      \  }}|t        d      |j	                         } ||ddg|      \  }}|t        d      |j	                         }i }	||	d<   |dd |	d<   d|	d<   |}
|
j                  d      }||	d<   |r|
d|
j                  d       }
d|
v rt        j                  d|
      }|s
d |z  |	d<   |	S |j                  d!      }|j                  |       s"|rd"}t        ||| fz         d#|d$| d%|	d<   |	S |t        |       d |	d&<   t        |j                  d'            |	d(<   |j                  d)      |	d<   n#d|	d&<    ||g d*|      \  }}t        |      |	d(<    ||g d+|      d	   j	                         }|j	                         j                  d,d-d!      j                  d,d.d!      |	d/<   |	S )0a  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   win32zgit.cmdzgit.exez	rev-parsez	--git-dirT)r,   rE   r   z"Directory %s not under git controlz('git rev-parse --git-dir' returned errordescribez--tagsz--dirtyz--alwaysz--longz--matchz%s*)r,   Nz'git describe' failedHEADz'git rev-parse' failedlong   shortrO   -dirtyrN   -z^(.+)-(\d+)-g([0-9a-f]+)$z)unable to parse git-describe output: '%s'r0   z'tag '%s' doesn't start with prefix '%s'ztag 'z' doesn't start with prefix ''closest-tag   distancer1   )zrev-listr}   z--count)showz-sz--format=%cir}   ri   rj   rk   r   )r9   platformr=   r"   r?   endswithrindexr`   ra   rb   rT   rU   intro   )r   rX   r   rJ   GITSoutrcdescribe_outfull_outpiecesgit_describerN   rf   full_tagfmt	count_outr   s                    r   git_pieces_from_vcsr      s    7D
||w9%$k :&*,GC	Qw6=>FGG #4*h	*4h*3UZ5G*I (,-L"
 344%%'Ltk6%:ELHb455~~HFF6NrlF7OF7O  L !!(+EF7O#$B\%8%8%BC lYY3\BJ!- .F7OM 88A;"":.?cXz223"*J 8F7OM (Z)9 :} !!-z ((1+w !%}#D*I(,.	2 ^z tC!!"$$)EG 	ZZ\))#sA6>>sBJF6NMr   c                 .    d| j                  dd      v ryy)z8Return a + if we don't already have one, else return a .+r   rk   .)rn   )r   s    r   plus_or_dotr   4  s    
fjj++r   c                     | d   r9| d   }| d   s| d   r(|t        |       z  }|d| d   | d   fz  z  }| d   r|dz  }|S d| d   | d   fz  }| 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   rN   z%d.g%sr   z.dirtyz0+untagged.%d.g%sr   r   rendereds     r   render_pep440r   ;  s     m-(*F++HF:$6w#HHHHgH$ O	 '&*<*0/*; ;'? HOr   c                 N    | d   r| d   }| d   r|d| d   z  z  }|S d| d   z  }|S )z]TAG[.post.devDISTANCE] -- No -dirty.

    Exceptions:
    1: no tags. 0.post.devDISTANCE
    r   r   z.post.dev%dz0.post.dev%dr   r   s     r   render_pep440_prer   T  sO     m-(*z(:::H O "F:$66Or   c                     | d   r?| d   }| d   s| d   r.|d| d   z  z  }| d   r|dz  }|t        |       z  }|d| d   z  z  }|S d| d   z  }| d   r|dz  }|d	| d   z  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   rN   .post%d.dev0zg%sr   0.post%dz+g%sr   r   s     r   render_pep440_postr   d  s     m-(*	F:$666HgG#F++Hw//H O	 z 22'?HFVG_,,Or   c                     | d   r&| d   }| d   s| d   r|d| d   z  z  }| d   r|dz  }|S d| d   z  }| d   r|dz  }|S )zvTAG[.postDISTANCE[.dev0]] .

    The ".dev0" means dirty.

    Eexceptions:
    1: no tags. 0.postDISTANCE[.dev0]
    r   r   rN   r   r   r   r   r   s     r   render_pep440_oldr     sw     m-(*	F:$666HgG# O z 22'?HOr   c                 d    | d   r| d   }| d   r|d| d   | d   fz  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   -%d-g%sr   rN   r   r   r   s     r   render_git_describer     s\     m-(*	VJ%7$IIIH '?gHOr   c                 Z    | d   r| d   }|d| d   | d   fz  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   rN   r   r   r   s     r   render_git_describe_longr     sT     m-(I
!3VG_ EEE '?gHOr   c                 t   | d   rd| j                  d      d| d   ddS |r|dk(  rd}|dk(  rt        |       }nc|dk(  rt        |       }nR|d	k(  rt        |       }nA|d
k(  rt	        |       }n0|dk(  rt        |       }n|dk(  rt        |       }nt        d|z        || d   | d   d| j                  d      dS )z9Render the given version pieces into the requested style.rO   unknownr~   NrL   defaultr   z
pep440-prezpep440-postz
pep440-oldzgit-describezgit-describe-longzunknown style '%s'rN   r   )rn   r   r   r   r   r   r   
ValueError)r   r   r   s      r   renderr     s    g$#)::f#5	 	 EY& (	,	$V,	-	%f-	,	$V,	.	 &v.	%	%+F3-566F6NG_tJJv&( (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./rm   Nz"unable to find root of source treerL   zunable to compute version)r    r   rx   r   r   r"   rQ   rR   realpath__file__r   rq   rW   	NameErrorr   r   r   r   r[   )r   r   rX   rZ   r   s        r   get_versionsr     sH    ,CkkG),.#..*13 	3 ww) ''--c2 	)A77??4(D	) &4= 	$S^^T7Cfcii(( *3+?+?wOO    #t0$@ @sF   7 	AAA"B* *B>=B>,C/ /	C;:C;?"D# #	D/.D/)NFFN)r   r;   rQ   r`   r5   r9   r   r   r    	Exceptionr"   LONG_VERSION_PYr%   r*   rJ   r[   rg   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s    )  	 	  

= =NI N  FK" JG2 e^, -8 eZ(3G )3Gl e./?J X 0Xv2 6,(((@+@r   