python-babel: bump to 2.18.0

Changelog: https://github.com/python-babel/babel/blob/master/CHANGES.rst

Minor release with bug fixes. Resets PKG_RELEASE to 1.
Add test.sh to verify locale, date, and number formatting.

Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This commit is contained in:
Alexandru Ardelean
2026-04-04 21:37:47 +03:00
committed by Alexandru Ardelean
parent 753282cb9b
commit 387b6197cc
2 changed files with 27 additions and 3 deletions

View File

@@ -8,11 +8,11 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=python-babel
PKG_VERSION:=2.17.0
PKG_RELEASE:=3
PKG_VERSION:=2.18.0
PKG_RELEASE:=1
PYPI_NAME:=babel
PKG_HASH:=0c54cffb19f690cdcc52a3b50bcbf71e07a808d1c80d549f2459b9d2cf0afb9d
PKG_HASH:=b80b99a14bd085fcacfa15c9165f651fbb3406e66cc603abf11c5750937c992d
PKG_MAINTAINER:=Josef Schlehofer <pepe.schlehofer@gmail.com>
PKG_LICENSE:=BSD-3-Clause

View File

@@ -0,0 +1,24 @@
#!/bin/sh
[ "$1" = python3-babel ] || exit 0
python3 - << 'EOF'
import babel
assert babel.__version__, "babel version is empty"
from babel import Locale
from babel.dates import format_date, format_datetime
from babel.numbers import format_number, format_currency
import datetime
locale = Locale.parse("en_US")
assert locale.territory == "US"
d = datetime.date(2024, 1, 15)
formatted = format_date(d, locale="en_US")
assert "2024" in formatted, f"date format missing year: {formatted}"
n = format_number(1234567.89, locale="en_US")
assert "1,234,567" in n, f"number format unexpected: {n}"
c = format_currency(9.99, "USD", locale="en_US")
assert "$" in c or "USD" in c, f"currency format unexpected: {c}"
EOF