From 0294b98ee542d5cfbd8ca2f03dc7117fc02cb3eb Mon Sep 17 00:00:00 2001 From: Ruihang Lai Date: Mon, 9 Mar 2026 10:54:52 -0400 Subject: [PATCH] [Build] Fix version regex to anchor at line start in pyproject.toml Add ^ anchor to the version regex so it matches only the top-level `version = "..."` instead of all three occurrences, which caused hit_count == 3 and a RuntimeError in sync_version. --- version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.py b/version.py index ee7d0cdb5554..fc9d4449c31d 100644 --- a/version.py +++ b/version.py @@ -180,7 +180,7 @@ def sync_version(pub_ver, local_ver, dry_run): # pyproject.toml update( os.path.join(PROJ_ROOT, "pyproject.toml"), - r"(?<=version = \")[.0-9a-z\+]+", + r"(?<=^version = \")[.0-9a-z\+]+", pub_ver, dry_run, )