Skip to content

Commit 0907fe6

Browse files
ianpittwoodclaude
andcommitted
Fix version_matches ignoring dep_versions for matrix version strings
When both version strings were dep-prefixed (e.g. R4.5.3-python3.14.3), version_matches only compared the first dep's release tuple, making R4.5.3-python3.14.3 incorrectly match R4.5.3-python3.13.0. Now compares dep_versions with prefix semantics, consistent with calver release matching. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 95888db commit 0907fe6

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

posit-bakery/posit_bakery/config/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ def version_matches(ver_name: str, filter_version: str) -> bool:
266266
ver = ParsedVersion.parse(ver_name)
267267
filt = ParsedVersion.parse(filter_version)
268268
if ver is not None and filt is not None:
269+
if ver.dep_versions is not None or filt.dep_versions is not None:
270+
if ver.dep_versions is None or filt.dep_versions is None:
271+
return False
272+
return ver.dep_versions[: len(filt.dep_versions)] == filt.dep_versions
269273
return ver.release[: len(filt.release)] == filt.release and (
270274
filt.prerelease is None or ver.prerelease == filt.prerelease
271275
)

posit-bakery/test/cli/test_ci.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ class TestVersionMatches:
144144
("2026.03.1", "2026.03"),
145145
("2026.05.0-dev+15-gSHA", "2026.05.0-dev"),
146146
("R4.5.3-python3.14.3", "R4.5.3-python3.14.3"),
147+
("R4.5.3-python3.14.3", "R4.5.3"),
147148
],
148149
)
149150
def test_matches(self, ver_name, filter_version):

0 commit comments

Comments
 (0)