Skip to content

Commit

Permalink
Docs: update documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Jun 10, 2022
1 parent 520c0be commit b8dcd5f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hatch_nodejs_version/version_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# The Python-aware NodeJS version regex
# This is very similar to `packaging.version.VERSION_PATTERN`, with a few changes:
# - Don't accept underscores
# - Only support three-component release and prerelease segments
# - Require - to indicate prerelease
NODE_VERSION_PATTERN = r"""
(?P<major>[0-9]+) # major
Expand All @@ -27,8 +28,7 @@

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

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

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

0 comments on commit b8dcd5f

Please sign in to comment.