Skip to content

Commit b8dcd5f

Browse files
committed
Docs: update documentation comments
1 parent 520c0be commit b8dcd5f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hatch_nodejs_version/version_source.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# The Python-aware NodeJS version regex
1111
# This is very similar to `packaging.version.VERSION_PATTERN`, with a few changes:
1212
# - Don't accept underscores
13+
# - Only support three-component release and prerelease segments
1314
# - Require - to indicate prerelease
1415
NODE_VERSION_PATTERN = r"""
1516
(?P<major>[0-9]+) # major
@@ -27,8 +28,7 @@
2728

2829
# The NodeJS-aware Python version regex
2930
# This is very similar to `packaging.version.VERSION_PATTERN`, with a few changes:
30-
# - Don't accept epochs or local packages
31-
# - Require three components
31+
# - Only support three-component release and prerelease segments
3232
PYTHON_VERSION_PATTERN = r"""
3333
v?
3434
(?:
@@ -52,7 +52,6 @@ class NodeJSVersionSource(VersionSourceInterface):
5252

5353
def node_version_to_python(self, version: str) -> str:
5454
# NodeJS version strings are a near superset of Python version strings
55-
# We opt to read the pre.post.dev from the NodeJS pre field
5655
match = re.match(
5756
r"^\s*" + NODE_VERSION_PATTERN + r"\s*$",
5857
version,
@@ -73,7 +72,6 @@ def node_version_to_python(self, version: str) -> str:
7372

7473
def python_version_to_node(self, version: str) -> str:
7574
# NodeJS version strings are a near superset of Python version strings
76-
# We opt to read the pre.post.dev from the NodeJS pre field
7775
match = re.match(
7876
r"^\s*" + PYTHON_VERSION_PATTERN + r"\s*$",
7977
version,

0 commit comments

Comments
 (0)