66# that just contains the computed version number.
77
88# This file is released into the public domain.
9- # Generated by versioneer-0.28
9+ # Generated by versioneer-0.29
1010# https://github.com/python-versioneer/python-versioneer
1111
1212"""Git implementation of _version.py."""
1717import re
1818import subprocess
1919import sys
20- from typing import Callable , Dict
20+ from typing import Any , Callable , Dict , List , Optional , Tuple
2121
2222
23- def get_keywords ():
23+ def get_keywords () -> Dict [ str , str ] :
2424 """Get the keywords needed to look up the version information."""
2525 # these strings will be replaced by git during git-archive.
2626 # setup.py/versioneer.py will grep for the variable names, so they must
@@ -36,17 +36,24 @@ def get_keywords():
3636class VersioneerConfig :
3737 """Container for Versioneer configuration parameters."""
3838
39+ VCS : str
40+ style : str
41+ tag_prefix : str
42+ parentdir_prefix : str
43+ versionfile_source : str
44+ verbose : bool
3945
40- def get_config ():
46+
47+ def get_config () -> VersioneerConfig :
4148 """Create, populate and return the VersioneerConfig() object."""
4249 # these strings are filled in when 'setup.py versioneer' creates
4350 # _version.py
4451 cfg = VersioneerConfig ()
4552 cfg .VCS = "git"
4653 cfg .style = "pep440"
4754 cfg .tag_prefix = "v"
48- cfg .parentdir_prefix = ""
49- cfg .versionfile_source = "picachooser /_version.py"
55+ cfg .parentdir_prefix = "rapidtide- "
56+ cfg .versionfile_source = "rapidtide /_version.py"
5057 cfg .verbose = False
5158 return cfg
5259
@@ -59,9 +66,9 @@ class NotThisMethod(Exception):
5966HANDLERS : Dict [str , Dict [str , Callable ]] = {}
6067
6168
62- def register_vcs_handler (vcs , method ) : # decorator
69+ def register_vcs_handler (vcs : str , method : str ) -> Callable : # decorator
6370 """Create decorator to mark a method as the handler of a VCS."""
64- def decorate (f ) :
71+ def decorate (f : Callable ) -> Callable :
6572 """Store f in HANDLERS[vcs][method]."""
6673 if vcs not in HANDLERS :
6774 HANDLERS [vcs ] = {}
@@ -70,13 +77,19 @@ def decorate(f):
7077 return decorate
7178
7279
73- def run_command (commands , args , cwd = None , verbose = False , hide_stderr = False ,
74- env = None ):
80+ def run_command (
81+ commands : List [str ],
82+ args : List [str ],
83+ cwd : Optional [str ] = None ,
84+ verbose : bool = False ,
85+ hide_stderr : bool = False ,
86+ env : Optional [Dict [str , str ]] = None ,
87+ ) -> Tuple [Optional [str ], Optional [int ]]:
7588 """Call the given command(s)."""
7689 assert isinstance (commands , list )
7790 process = None
7891
79- popen_kwargs = {}
92+ popen_kwargs : Dict [ str , Any ] = {}
8093 if sys .platform == "win32" :
8194 # This hides the console window if pythonw.exe is used
8295 startupinfo = subprocess .STARTUPINFO ()
@@ -92,8 +105,7 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
92105 stderr = (subprocess .PIPE if hide_stderr
93106 else None ), ** popen_kwargs )
94107 break
95- except OSError :
96- e = sys .exc_info ()[1 ]
108+ except OSError as e :
97109 if e .errno == errno .ENOENT :
98110 continue
99111 if verbose :
@@ -113,7 +125,11 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
113125 return stdout , process .returncode
114126
115127
116- def versions_from_parentdir (parentdir_prefix , root , verbose ):
128+ def versions_from_parentdir (
129+ parentdir_prefix : str ,
130+ root : str ,
131+ verbose : bool ,
132+ ) -> Dict [str , Any ]:
117133 """Try to determine the version from the parent directory name.
118134
119135 Source tarballs conventionally unpack into a directory that includes both
@@ -138,13 +154,13 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
138154
139155
140156@register_vcs_handler ("git" , "get_keywords" )
141- def git_get_keywords (versionfile_abs ) :
157+ def git_get_keywords (versionfile_abs : str ) -> Dict [ str , str ] :
142158 """Extract version information from the given file."""
143159 # the code embedded in _version.py can just fetch the value of these
144160 # keywords. When used from setup.py, we don't want to import _version.py,
145161 # so we do it with a regexp instead. This function is not used from
146162 # _version.py.
147- keywords = {}
163+ keywords : Dict [ str , str ] = {}
148164 try :
149165 with open (versionfile_abs , "r" ) as fobj :
150166 for line in fobj :
@@ -166,7 +182,11 @@ def git_get_keywords(versionfile_abs):
166182
167183
168184@register_vcs_handler ("git" , "keywords" )
169- def git_versions_from_keywords (keywords , tag_prefix , verbose ):
185+ def git_versions_from_keywords (
186+ keywords : Dict [str , str ],
187+ tag_prefix : str ,
188+ verbose : bool ,
189+ ) -> Dict [str , Any ]:
170190 """Get version information from git keywords."""
171191 if "refnames" not in keywords :
172192 raise NotThisMethod ("Short version file found" )
@@ -230,7 +250,12 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
230250
231251
232252@register_vcs_handler ("git" , "pieces_from_vcs" )
233- def git_pieces_from_vcs (tag_prefix , root , verbose , runner = run_command ):
253+ def git_pieces_from_vcs (
254+ tag_prefix : str ,
255+ root : str ,
256+ verbose : bool ,
257+ runner : Callable = run_command
258+ ) -> Dict [str , Any ]:
234259 """Get version from 'git describe' in the root of the source tree.
235260
236261 This only gets called if the git-archive 'subst' keywords were *not*
@@ -270,7 +295,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
270295 raise NotThisMethod ("'git rev-parse' failed" )
271296 full_out = full_out .strip ()
272297
273- pieces = {}
298+ pieces : Dict [ str , Any ] = {}
274299 pieces ["long" ] = full_out
275300 pieces ["short" ] = full_out [:7 ] # maybe improved later
276301 pieces ["error" ] = None
@@ -362,14 +387,14 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
362387 return pieces
363388
364389
365- def plus_or_dot (pieces ) :
390+ def plus_or_dot (pieces : Dict [ str , Any ]) -> str :
366391 """Return a + if we don't already have one, else return a ."""
367392 if "+" in pieces .get ("closest-tag" , "" ):
368393 return "."
369394 return "+"
370395
371396
372- def render_pep440 (pieces ) :
397+ def render_pep440 (pieces : Dict [ str , Any ]) -> str :
373398 """Build up version string, with post-release "local version identifier".
374399
375400 Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if you
@@ -394,7 +419,7 @@ def render_pep440(pieces):
394419 return rendered
395420
396421
397- def render_pep440_branch (pieces ) :
422+ def render_pep440_branch (pieces : Dict [ str , Any ]) -> str :
398423 """TAG[[.dev0]+DISTANCE.gHEX[.dirty]] .
399424
400425 The ".dev0" means not master branch. Note that .dev0 sorts backwards
@@ -424,7 +449,7 @@ def render_pep440_branch(pieces):
424449 return rendered
425450
426451
427- def pep440_split_post (ver ) :
452+ def pep440_split_post (ver : str ) -> Tuple [ str , Optional [ int ]] :
428453 """Split pep440 version string at the post-release segment.
429454
430455 Returns the release segments before the post-release and the
@@ -434,7 +459,7 @@ def pep440_split_post(ver):
434459 return vc [0 ], int (vc [1 ] or 0 ) if len (vc ) == 2 else None
435460
436461
437- def render_pep440_pre (pieces ) :
462+ def render_pep440_pre (pieces : Dict [ str , Any ]) -> str :
438463 """TAG[.postN.devDISTANCE] -- No -dirty.
439464
440465 Exceptions:
@@ -458,7 +483,7 @@ def render_pep440_pre(pieces):
458483 return rendered
459484
460485
461- def render_pep440_post (pieces ) :
486+ def render_pep440_post (pieces : Dict [ str , Any ]) -> str :
462487 """TAG[.postDISTANCE[.dev0]+gHEX] .
463488
464489 The ".dev0" means dirty. Note that .dev0 sorts backwards
@@ -485,7 +510,7 @@ def render_pep440_post(pieces):
485510 return rendered
486511
487512
488- def render_pep440_post_branch (pieces ) :
513+ def render_pep440_post_branch (pieces : Dict [ str , Any ]) -> str :
489514 """TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .
490515
491516 The ".dev0" means not master branch.
@@ -514,7 +539,7 @@ def render_pep440_post_branch(pieces):
514539 return rendered
515540
516541
517- def render_pep440_old (pieces ) :
542+ def render_pep440_old (pieces : Dict [ str , Any ]) -> str :
518543 """TAG[.postDISTANCE[.dev0]] .
519544
520545 The ".dev0" means dirty.
@@ -536,7 +561,7 @@ def render_pep440_old(pieces):
536561 return rendered
537562
538563
539- def render_git_describe (pieces ) :
564+ def render_git_describe (pieces : Dict [ str , Any ]) -> str :
540565 """TAG[-DISTANCE-gHEX][-dirty].
541566
542567 Like 'git describe --tags --dirty --always'.
@@ -556,7 +581,7 @@ def render_git_describe(pieces):
556581 return rendered
557582
558583
559- def render_git_describe_long (pieces ) :
584+ def render_git_describe_long (pieces : Dict [ str , Any ]) -> str :
560585 """TAG-DISTANCE-gHEX[-dirty].
561586
562587 Like 'git describe --tags --dirty --always -long'.
@@ -576,7 +601,7 @@ def render_git_describe_long(pieces):
576601 return rendered
577602
578603
579- def render (pieces , style ) :
604+ def render (pieces : Dict [ str , Any ], style : str ) -> Dict [ str , Any ] :
580605 """Render the given version pieces into the requested style."""
581606 if pieces ["error" ]:
582607 return {"version" : "unknown" ,
@@ -612,7 +637,7 @@ def render(pieces, style):
612637 "date" : pieces .get ("date" )}
613638
614639
615- def get_versions ():
640+ def get_versions () -> Dict [ str , Any ] :
616641 """Get version information or return default if unable to do so."""
617642 # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
618643 # __file__, we can work backwards from there to the root. Some
0 commit comments