Skip to content

Commit 0053ea0

Browse files
8W9aGnevillelyh
authored andcommitted
Check if pep440 starts with semver
1 parent b877ab1 commit 0053ea0

File tree

1 file changed

+2
-2
lines changed
  • test-integration/test_integration

1 file changed

+2
-2
lines changed

test-integration/test_integration/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from packaging.version import VERSION_PATTERN
1313

1414
# From the SemVer spec: https://semver.org/
15-
SEMVER_PATTERN = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9A-Za-z-]{1,9})[0-9A-Za-z-]*(?:\.[0-9A-Za-z-]+)*)?$"
15+
SEMVER_PATTERN = r"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"
1616

1717

1818
# Used to help ensure that the cog binary reports a semver version that matches
@@ -93,7 +93,7 @@ def assert_versions_match(semver_version: str, pep440_version: str):
9393
if semver_pre.startswith("dev"):
9494
assert pep440_groups["dev_l"] == "dev", "Dev build status does not match"
9595

96-
assert semver_groups["buildmetadata"] == pep440_groups["local"], (
96+
assert pep440_groups["local"].startswith(semver_groups["buildmetadata"]), (
9797
f"Local/build metadata component does not match: {semver_groups['buildmetadata']} != {pep440_groups['local']}"
9898
)
9999

0 commit comments

Comments
 (0)