mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-13 15:00:15 +01:00
WIP: more testing
This commit is contained in:
parent
5108837f45
commit
0a3638a62f
6 changed files with 94 additions and 7 deletions
|
|
@ -17,7 +17,7 @@ VALID_RELESE_VALUES = ("alpha", "beta", "dev", "rc", "post")
|
|||
|
||||
|
||||
# https://regex101.com/r/fnj60p/10
|
||||
PYCALVER_RE: typ.re.Pattern[str] = re.compile(r"""
|
||||
PYCALVER_RE: typ.Pattern[str] = re.compile(r"""
|
||||
\b
|
||||
(?P<version>
|
||||
(?P<calver>
|
||||
|
|
@ -75,6 +75,8 @@ class VersionInfo(typ.NamedTuple):
|
|||
|
||||
def parse_version_info(version: str) -> VersionInfo:
|
||||
match = PYCALVER_RE.match(version)
|
||||
if match is None:
|
||||
raise ValueError(f"Invalid pycalver: {version}")
|
||||
pep440_version = str(pkg_resources.parse_version(version))
|
||||
return VersionInfo(pep440_version=pep440_version, **match.groupdict())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue