Skip to content

Commit 486a4a3

Browse files
committed
Reformatted with black
1 parent f229725 commit 486a4a3

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

src/semver/versionregex.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ class VersionRegex:
1515
_RE_NUMBER: ClassVar[str] = r"0|[1-9]\d*"
1616

1717
#:
18-
_LAST_NUMBER: ClassVar[Pattern[str]] = re.compile(r"(?:[^\d]*(\d+)[^\d]*)+")
18+
_LAST_NUMBER: ClassVar[Pattern[str]] = re.compile(r"(?:[^\d]*(\d+)[^\d]*)+")
1919

2020
#: The names of the different parts of a version
21-
NAMES: ClassVar[Tuple[str, ...]] = ("major", "minor", "patch", "prerelease", "build")
21+
NAMES: ClassVar[Tuple[str, ...]] = (
22+
"major",
23+
"minor",
24+
"patch",
25+
"prerelease",
26+
"build",
27+
)
2228

2329
#: The regex of the major part of a version:
2430
MAJOR: ClassVar[str] = rf"(?P<major>{_RE_NUMBER})"
@@ -27,20 +33,26 @@ class VersionRegex:
2733
#: The regex of the patch part of a version:
2834
PATCH: ClassVar[str] = rf"(?P<patch>{_RE_NUMBER})"
2935
#: The regex of the prerelease part of a version:
30-
PRERELEASE: ClassVar[str] = rf"""(?P<prerelease>
36+
PRERELEASE: ClassVar[
37+
str
38+
] = rf"""(?P<prerelease>
3139
(?:{_RE_NUMBER}|\d*[a-zA-Z-][0-9a-zA-Z-]*)
3240
(?:\.(?:{_RE_NUMBER}|\d*[a-zA-Z-][0-9a-zA-Z-]*))*
3341
)
3442
"""
3543

3644
#: The regex of the build part of a version:
37-
BUILD: ClassVar[str] = r"""(?P<build>
45+
BUILD: ClassVar[
46+
str
47+
] = r"""(?P<build>
3848
[0-9a-zA-Z-]+
3949
(?:\.[0-9a-zA-Z-]+)*
4050
)"""
4151

4252
#: Regex template for a semver version
43-
REGEX_TEMPLATE: ClassVar[str] = rf"""
53+
REGEX_TEMPLATE: ClassVar[
54+
str
55+
] = rf"""
4456
^
4557
{MAJOR}
4658
(?:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy