mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-13 23:03:54 +01:00
setup to reduce code duplication
This commit is contained in:
parent
e053af589e
commit
3cbf0e82b1
10 changed files with 271 additions and 267 deletions
|
|
@ -33,6 +33,8 @@
|
|||
import re
|
||||
import typing as typ
|
||||
|
||||
import pycalver.patterns as v1patterns
|
||||
|
||||
# https://regex101.com/r/fnj60p/10
|
||||
PYCALVER_PATTERN = r"""
|
||||
\b
|
||||
|
|
@ -192,9 +194,10 @@ def compile_pattern_str(pattern: str) -> str:
|
|||
return _replace_pattern_parts(pattern)
|
||||
|
||||
|
||||
def compile_pattern(pattern: str) -> typ.Pattern[str]:
|
||||
def compile_pattern(pattern: str) -> v1patterns.Pattern:
|
||||
pattern_str = compile_pattern_str(pattern)
|
||||
return re.compile(pattern_str)
|
||||
pattern_re = re.compile(pattern_str)
|
||||
return v1patterns.Pattern(pattern, pattern_re)
|
||||
|
||||
|
||||
def _init_composite_patterns() -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue