From e2dfe05a246c6082fd16960a13446e1479d67f3d Mon Sep 17 00:00:00 2001 From: wpbonelli Date: Sat, 20 Jan 2024 12:16:49 -0500 Subject: [PATCH] ci(dist): fix check_dist.py version string validation (#1565) * only require strictly numeric version string for approved releases --- distribution/check_dist.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/distribution/check_dist.py b/distribution/check_dist.py index 87c545469d5..719199a8ed6 100644 --- a/distribution/check_dist.py +++ b/distribution/check_dist.py @@ -190,11 +190,12 @@ def test_binaries(dist_dir_path, approved): # check version numbers version = output.lower().split(" ")[1] - print(version) + print("Version string:", version) v_split = version.split(".") assert len(v_split) >= 3 - assert all(s.isdigit() for s in v_split[:3]) + + # approved release should use semantic version number with + # exactly 3 components and no alphabetic characters in it if approved: assert len(v_split) == 3 - else: - assert "dev" in v_split[3] + assert all(s.isdigit() for s in v_split[:3])