From b8dcd5f9eabbde4ee2cc8c8915230ac488442f72 Mon Sep 17 00:00:00 2001 From: Angus Hollands Date: Fri, 10 Jun 2022 22:00:32 +0100 Subject: [PATCH] Docs: update documentation comments --- hatch_nodejs_version/version_source.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hatch_nodejs_version/version_source.py b/hatch_nodejs_version/version_source.py index 1af169c..23375e6 100644 --- a/hatch_nodejs_version/version_source.py +++ b/hatch_nodejs_version/version_source.py @@ -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[0-9]+) # major @@ -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? (?: @@ -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, @@ -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,