Repository: pypa/setuptools_scm

Issue:
get_version(): normalize=False incompatible with several version schemes
running anything that calls this function with 
-release-branch-semver
-python-simplified-semver

an error is thrown:

e.g. `ValueError: <ScmVersion v2.0.0 dist=0 node=g17520db dirty=True branch=branch-name> can't be parsed as numeric version`

Discussion:

Patch:
diff --git a/changelog.d/20240305_102047_allow_non_normalized_semver.md b/changelog.d/20240305_102047_allow_non_normalized_semver.md
new file mode 100644
index 0000000..f5d8567
--- /dev/null
+++ b/changelog.d/20240305_102047_allow_non_normalized_semver.md
@@ -0,0 +1,4 @@
+
+### Fixed
+
+- fix #1018: allow non-normalized versions for semver
diff --git a/src/setuptools_scm/version.py b/src/setuptools_scm/version.py
index 742abe6..0a36742 100644
--- a/src/setuptools_scm/version.py
+++ b/src/setuptools_scm/version.py
@@ -244,10 +244,13 @@ def guess_next_dev_version(version: ScmVersion) -> str:
 def guess_next_simple_semver(
     version: ScmVersion, retain: int, increment: bool = True
 ) -> str:
-    try:
-        parts = [int(i) for i in str(version.tag).split(".")[:retain]]
-    except ValueError:
-        raise ValueError(f"{version} can't be parsed as numeric version") from None
+    if isinstance(version.tag, _v.Version):
+        parts = list(version.tag.release[:retain])
+    else:
+        try:
+            parts = [int(i) for i in str(version.tag).split(".")[:retain]]
+        except ValueError:
+            raise ValueError(f"{version} can't be parsed as numeric version") from None
     while len(parts) < retain:
         parts.append(0)
     if increment:


Test patch:
diff --git a/testing/test_version.py b/testing/test_version.py
index 8a823d8..371c754 100644
--- a/testing/test_version.py
+++ b/testing/test_version.py
@@ -54,6 +54,11 @@ c_non_normalize = Configuration(version_cls=NonNormalizedVersion)
             "1.1.0.dev2",
             id="feature_in_branch",
         ),
+        pytest.param(
+            meta(NonNormalizedVersion("v1.0"), distance=2, branch="default", config=c),
+            "1.0.1.dev2",
+            id="non-normalized-allowed",
+        ),
     ],
 )
 def test_next_semver(version: ScmVersion, expected_next: str) -> None: