release: Parse version.py using the language it was written in.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-07-25 13:05:40 -07:00 committed by Tim Abbott
parent 6f4d4eebe8
commit cd4052cf8a
1 changed files with 1 additions and 4 deletions

View File

@ -76,10 +76,7 @@ expected_date="$(TZ=America/Los_Angeles date +%F)"
|| fail "Date in docs/overview/changelog.md does not match '$expected_date'" || fail "Date in docs/overview/changelog.md does not match '$expected_date'"
extract_version() { extract_version() {
setting="$1" python3 -c 'import sys, version; print(getattr(version, sys.argv[1]))' "$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"
} }
# Check ZULIP_VERSION and LATEST_RELEASE_VERSION are set appropriately # Check ZULIP_VERSION and LATEST_RELEASE_VERSION are set appropriately