mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
make fmt
This commit is contained in:
parent
da44922261
commit
ad837c09dd
3 changed files with 74 additions and 74 deletions
|
|
@ -75,51 +75,51 @@ PART_PATTERNS = {
|
|||
'VV': r"5[0-3]|[1-4][0-9]|[1-9]",
|
||||
'0V': r"5[0-3]|[1-4][0-9]|0[1-9]",
|
||||
# non calver parts
|
||||
'MAJOR': r"[0-9]+",
|
||||
'MINOR': r"[0-9]+",
|
||||
'PATCH': r"[0-9]+",
|
||||
'BUILD': r"[0-9]+",
|
||||
'BLD' : r"[1-9][0-9]*",
|
||||
'TAG' : r"preview|final|alpha|beta|post|rc",
|
||||
'PYTAG': r"post|rc|a|b",
|
||||
'GITHASH' : r"\.[0-9]+\+.*",
|
||||
'NUM' : r"[0-9]+",
|
||||
'INC0' : r"[0-9]+",
|
||||
'INC1' : r"[1-9][0-9]*",
|
||||
'MAJOR' : r"[0-9]+",
|
||||
'MINOR' : r"[0-9]+",
|
||||
'PATCH' : r"[0-9]+",
|
||||
'BUILD' : r"[0-9]+",
|
||||
'BLD' : r"[1-9][0-9]*",
|
||||
'TAG' : r"preview|final|alpha|beta|post|rc",
|
||||
'PYTAG' : r"post|rc|a|b",
|
||||
'GITHASH': r"\.[0-9]+\+.*",
|
||||
'NUM' : r"[0-9]+",
|
||||
'INC0' : r"[0-9]+",
|
||||
'INC1' : r"[1-9][0-9]*",
|
||||
}
|
||||
|
||||
|
||||
PATTERN_PART_FIELDS = {
|
||||
'YYYY' : 'year_y',
|
||||
'YY' : 'year_y',
|
||||
'0Y' : 'year_y',
|
||||
'GGGG' : 'year_g',
|
||||
'GG' : 'year_g',
|
||||
'0G' : 'year_g',
|
||||
'Q' : 'quarter',
|
||||
'MM' : 'month',
|
||||
'0M' : 'month',
|
||||
'DD' : 'dom',
|
||||
'0D' : 'dom',
|
||||
'JJJ' : 'doy',
|
||||
'00J' : 'doy',
|
||||
'MAJOR': 'major',
|
||||
'MINOR': 'minor',
|
||||
'PATCH': 'patch',
|
||||
'BUILD': 'bid',
|
||||
'BLD' : 'bid',
|
||||
'TAG' : 'tag',
|
||||
'PYTAG': 'pytag',
|
||||
'GITHASH' : 'githash',
|
||||
'NUM' : 'num',
|
||||
'INC0' : 'inc0',
|
||||
'INC1' : 'inc1',
|
||||
'WW' : 'week_w',
|
||||
'0W' : 'week_w',
|
||||
'UU' : 'week_u',
|
||||
'0U' : 'week_u',
|
||||
'VV' : 'week_v',
|
||||
'0V' : 'week_v',
|
||||
'YYYY' : 'year_y',
|
||||
'YY' : 'year_y',
|
||||
'0Y' : 'year_y',
|
||||
'GGGG' : 'year_g',
|
||||
'GG' : 'year_g',
|
||||
'0G' : 'year_g',
|
||||
'Q' : 'quarter',
|
||||
'MM' : 'month',
|
||||
'0M' : 'month',
|
||||
'DD' : 'dom',
|
||||
'0D' : 'dom',
|
||||
'JJJ' : 'doy',
|
||||
'00J' : 'doy',
|
||||
'MAJOR' : 'major',
|
||||
'MINOR' : 'minor',
|
||||
'PATCH' : 'patch',
|
||||
'BUILD' : 'bid',
|
||||
'BLD' : 'bid',
|
||||
'TAG' : 'tag',
|
||||
'PYTAG' : 'pytag',
|
||||
'GITHASH': 'githash',
|
||||
'NUM' : 'num',
|
||||
'INC0' : 'inc0',
|
||||
'INC1' : 'inc1',
|
||||
'WW' : 'week_w',
|
||||
'0W' : 'week_w',
|
||||
'UU' : 'week_u',
|
||||
'0U' : 'week_u',
|
||||
'VV' : 'week_v',
|
||||
'0V' : 'week_v',
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -190,36 +190,36 @@ FormatterFunc = typ.Callable[[FieldValue], str]
|
|||
|
||||
|
||||
PART_FORMATS: typ.Dict[str, FormatterFunc] = {
|
||||
'YYYY' : _fmt_num,
|
||||
'YY' : _fmt_yy,
|
||||
'0Y' : _fmt_0y,
|
||||
'GGGG' : _fmt_num,
|
||||
'GG' : _fmt_gg,
|
||||
'0G' : _fmt_0g,
|
||||
'Q' : _fmt_num,
|
||||
'MM' : _fmt_num,
|
||||
'0M' : _fmt_0m,
|
||||
'DD' : _fmt_num,
|
||||
'0D' : _fmt_0d,
|
||||
'JJJ' : _fmt_num,
|
||||
'00J' : _fmt_00j,
|
||||
'MAJOR': _fmt_num,
|
||||
'MINOR': _fmt_num,
|
||||
'PATCH': _fmt_num,
|
||||
'BUILD': _fmt_num,
|
||||
'BLD' : _fmt_bld,
|
||||
'TAG' : _fmt_num,
|
||||
'PYTAG': _fmt_num,
|
||||
'GITHASH' : _fmt_num,
|
||||
'NUM' : _fmt_num,
|
||||
'INC0' : _fmt_num,
|
||||
'INC1' : _fmt_num,
|
||||
'WW' : _fmt_num,
|
||||
'0W' : _fmt_0w,
|
||||
'UU' : _fmt_num,
|
||||
'0U' : _fmt_0u,
|
||||
'VV' : _fmt_num,
|
||||
'0V' : _fmt_0v,
|
||||
'YYYY' : _fmt_num,
|
||||
'YY' : _fmt_yy,
|
||||
'0Y' : _fmt_0y,
|
||||
'GGGG' : _fmt_num,
|
||||
'GG' : _fmt_gg,
|
||||
'0G' : _fmt_0g,
|
||||
'Q' : _fmt_num,
|
||||
'MM' : _fmt_num,
|
||||
'0M' : _fmt_0m,
|
||||
'DD' : _fmt_num,
|
||||
'0D' : _fmt_0d,
|
||||
'JJJ' : _fmt_num,
|
||||
'00J' : _fmt_00j,
|
||||
'MAJOR' : _fmt_num,
|
||||
'MINOR' : _fmt_num,
|
||||
'PATCH' : _fmt_num,
|
||||
'BUILD' : _fmt_num,
|
||||
'BLD' : _fmt_bld,
|
||||
'TAG' : _fmt_num,
|
||||
'PYTAG' : _fmt_num,
|
||||
'GITHASH': _fmt_num,
|
||||
'NUM' : _fmt_num,
|
||||
'INC0' : _fmt_num,
|
||||
'INC1' : _fmt_num,
|
||||
'WW' : _fmt_num,
|
||||
'0W' : _fmt_0w,
|
||||
'UU' : _fmt_num,
|
||||
'0U' : _fmt_0u,
|
||||
'VV' : _fmt_num,
|
||||
'0V' : _fmt_0v,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -221,8 +221,8 @@ def parse_field_values_to_vinfo(field_values: FieldValues) -> version.V2VersionI
|
|||
|
||||
fvals = field_values
|
||||
|
||||
tag = fvals.get('tag' ) or ""
|
||||
pytag = fvals.get('pytag') or ""
|
||||
tag = fvals.get('tag' ) or ""
|
||||
pytag = fvals.get('pytag' ) or ""
|
||||
githash = fvals.get('githash') or ""
|
||||
|
||||
if tag and not pytag:
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class V2VersionInfo(typ.NamedTuple):
|
|||
bid : str
|
||||
tag : str
|
||||
pytag : str
|
||||
githash : str
|
||||
githash: str
|
||||
num : int
|
||||
inc0 : int
|
||||
inc1 : int
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue