From cd4052cf8abc9bed78af1f3bade66f269a9b129f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 25 Jul 2024 13:05:40 -0700 Subject: [PATCH] release: Parse version.py using the language it was written in. Signed-off-by: Anders Kaseorg --- tools/release | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/release b/tools/release index 87d0b27e52..5b6f170850 100755 --- a/tools/release +++ b/tools/release @@ -76,10 +76,7 @@ expected_date="$(TZ=America/Los_Angeles date +%F)" || fail "Date in docs/overview/changelog.md does not match '$expected_date'" extract_version() { - setting="$1" - value=$(SETTING="$setting" perl -nle 'print $2 if /$ENV{SETTING} = (\"?)([^"]+)\1$/' version.py | head -n1) - [ -n "$value" ] || fail "Could not find $setting in version.py" - echo "$value" + python3 -c 'import sys, version; print(getattr(version, sys.argv[1]))' "$1" } # Check ZULIP_VERSION and LATEST_RELEASE_VERSION are set appropriately