From 236c264d7b3b74f46677e2944d102ffea76aa478 Mon Sep 17 00:00:00 2001 From: icp Date: Mon, 22 Aug 2022 13:13:20 +0530 Subject: [PATCH] python3-dateparser: update to 1.1.1. Close: #38833 --- .../patches/fix-python3-regex-incompatibility.patch | 12 ++++++++++++ srcpkgs/python3-dateparser/template | 12 ++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 srcpkgs/python3-dateparser/patches/fix-python3-regex-incompatibility.patch diff --git a/srcpkgs/python3-dateparser/patches/fix-python3-regex-incompatibility.patch b/srcpkgs/python3-dateparser/patches/fix-python3-regex-incompatibility.patch new file mode 100644 index 00000000000..536704ccfbf --- /dev/null +++ b/srcpkgs/python3-dateparser/patches/fix-python3-regex-incompatibility.patch @@ -0,0 +1,12 @@ +Source: https://github.com/scrapinghub/dateparser/pull/1067 +--- a/dateparser/languages/locale.py ++++ b/dateparser/languages/locale.py +@@ -169,7 +169,7 @@ class Locale: + if normalize: + value = list(map(normalize_unicode, value)) + pattern = '|'.join(sorted(value, key=len, reverse=True)) +- pattern = DIGIT_GROUP_PATTERN.sub(r'?P\d+', pattern) ++ pattern = pattern.replace(r'\d+', r'?P\d+') + pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE) + relative_dictionary[pattern] = key + return relative_dictionary diff --git a/srcpkgs/python3-dateparser/template b/srcpkgs/python3-dateparser/template index 9d7c54cd818..8185cc488fc 100644 --- a/srcpkgs/python3-dateparser/template +++ b/srcpkgs/python3-dateparser/template @@ -1,17 +1,21 @@ # Template file for 'python3-dateparser' pkgname=python3-dateparser -version=1.0.0 -revision=2 +version=1.1.1 +revision=1 wrksrc=dateparser-${version} build_style=python3-module +make_check_args="--ignore tests/test_hijri.py --ignore tests/test_jalali.py + --ignore tests/test_language_detect.py --ignore tests/test_dateparser_data_integrity.py" hostmakedepends="python3-setuptools" -depends="python3-dateutil python3-regex python3-tzlocal" +depends="python3-dateutil python3-pytz python3-regex python3-tzlocal" +checkdepends="${depends} python3-parameterized python3-pytest-xdist" short_desc="Python parser for human readable dates" maintainer="Lorem " license="BSD-3-Clause" homepage="https://github.com/scrapinghub/dateparser" +changelog="https://raw.githubusercontent.com/scrapinghub/dateparser/master/HISTORY.rst" distfiles="${PYPI_SITE}/d/dateparser/dateparser-${version}.tar.gz" -checksum=159cc4e01a593706a15cd4e269a0b3345edf3aef8bf9278a57dac8adf5bf1e4a +checksum=038196b1f12c7397e38aad3d61588833257f6f552baa63a1499e6987fa8d42d9 post_install() { vlicense LICENSE